< < TOTO
< > TOTO
< $ cat
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:3] cat
-> [0.000000] [tesh/INFO] Test suite from stdin OK
-$ ./tesh
+> Test suite from stdin
+> [stdin:3] cat
+> Test suite from stdin OK
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
p Order: out, in, cmd
< > TOTO
< < TOTO
< $ cat
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:3] cat
-> [0.000000] [tesh/INFO] Test suite from stdin OK
-$ ./tesh
+> Test suite from stdin
+> [stdin:3] cat
+> Test suite from stdin OK
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
p Order: out, cmd, in
< > TOTO
< $ cat
< < TOTO
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:2] cat
-> [0.000000] [tesh/INFO] Test suite from stdin OK
-$ ./tesh
+> Test suite from stdin
+> [stdin:2] cat
+> Test suite from stdin OK
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
p Order: in, cmd, out
< < TOTO
< $ cat
< > TOTO
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:2] cat
-> [0.000000] [tesh/INFO] Test suite from stdin OK
-$ ./tesh
+> Test suite from stdin
+> [stdin:2] cat
+> Test suite from stdin OK
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
p Order: cmd, out, in
< $ cat
< > TOTO
< < TOTO
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:1] cat
-> [0.000000] [tesh/INFO] Test suite from stdin OK
-$ ./tesh
+> Test suite from stdin
+> [stdin:1] cat
+> Test suite from stdin OK
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
p Order: cmd, in, out
< $ cat
< < TOTO
< > TOTO
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:1] cat
-> [0.000000] [tesh/INFO] Test suite from stdin OK
-$ ./tesh
+> Test suite from stdin
+> [stdin:1] cat
+> Test suite from stdin OK
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
! expect return 41
< $ ./return1
-$ ../tesh
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:1] ./return1
-> [0.000000] run_context.c:374: [tesh/ERROR] Child "./return1" returned code 1
+$ ../tesh --log='log.thresh:info tesh.fmt:%m%n'
+> Test suite from stdin
+> [stdin:1] ./return1
+> Test suite `(stdin)': NOK (<stdin:1> returned code 1)
+> Output of <stdin:1> so far:
+> ||
$ cd ..
$ rm -rf temp_testdir
! expect return 15
< $ ./segfault
-$ ../tesh
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:1] ./segfault
-> [0.000000] run_context.c:350: [tesh/ERROR] Child "./segfault" got signal SIGSEGV.
+$ ../tesh --log='log.thresh:info tesh.fmt:%m%n'
+> Test suite from stdin
+> [stdin:1] ./segfault
+> Test suite `(stdin)': NOK (<stdin:1> got signal SIGSEGV)
+> Output of <stdin:1> so far:
+> ||
$ cd ..
$ rm -rf temp_testdir
! expect return 3
< ! set timeout 1
< $ sleep 6
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:2] sleep 6
-> [0.000000] [tesh/INFO] Child 'sleep 6' timeouted. Kill it
-> [0.000000] run_context.c:335: [tesh/ERROR] Child timeouted (waited 1 sec)
-$ ./tesh
+> Test suite from stdin
+> [stdin:2] sleep 6
+> <stdin:2> timeouted. Kill the process.
+> <stdin:2> No output before timeout
+> Test suite `(stdin)': NOK (<stdin:2> timeout after 1 sec)
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
< > TOTO
< < TUTU
< $ cat
-$ ./tesh
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:3] cat
-> [0.000000] run_context.c:394: [tesh/ERROR] Output of child "cat" don't match expectations. Here is a diff between expected and got output:
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
+> Test suite from stdin
+> [stdin:3] cat
+> Output mismatch:
> - TOTO
> + TUTU
->
->
+> Test suite `(stdin)': NOK (<stdin:3> output mismatch)
+
# Check that there is nothing in the current dir (which must be testdir_temp)
$ ls
+# Check that tesh detects properly cd to non-existing directories
+! expect return 4
+< $ cd toto
+> Test suite from stdin
+> Chdir to toto failed: No such file or directory
+> Test suite `(stdin)': NOK (system error)
+$ ../tesh --log='log.thresh:info tesh.fmt:%m%n'
+
# The next command checks that there is a testdir_temp in the upper directory,
# ie that mkdir and cd both worked.
$ test -e ../testdir_temp
p This tests whether TESH accepts to ignore command output
-< ! ignore output
+< ! output ignore
< > TOTO
< < TUTU
< $ cat
-$ ./tesh
-> [0.000000] [tesh/INFO] Test suite from stdin
-> [0.000000] [tesh/INFO] [stdin:4] cat
-> [0.000000] [tesh/INFO] (ignoring the output as requested)
-> [0.000000] [tesh/INFO] Test suite from stdin OK
+$ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
+> Test suite from stdin
+> [stdin:4] cat
+> (ignoring the output as requested)
+> Test suite from stdin OK