Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Adapt the tests to the new code (and use log layouts to make sure we don't have to...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 6 Jun 2007 13:55:39 +0000 (13:55 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 6 Jun 2007 13:55:39 +0000 (13:55 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3566 48e7efb5-ca39-0410-a469-dd3cf9ba447f

tools/tesh/IO-orders.tesh
tools/tesh/catch-return.tesh
tools/tesh/catch-signal.tesh
tools/tesh/catch-timeout.tesh
tools/tesh/catch-wrong-output.tesh
tools/tesh/cd.tesh
tools/tesh/set-ignore-output.tesh

index 4862eb1..80cc596 100644 (file)
@@ -5,53 +5,53 @@ p Order: in, out, 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, 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'
 
index b69cc1e..fe8fe04 100644 (file)
@@ -16,10 +16,12 @@ $ gcc -o return1 return1.c
 
 ! 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
index 4fc0754..0d718c6 100644 (file)
@@ -17,10 +17,12 @@ $ gcc -o segfault segfault.c
 
 ! 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
index a5000a0..40aa37a 100644 (file)
@@ -6,8 +6,9 @@
 ! 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'
index ddeee94..c161efe 100644 (file)
@@ -6,11 +6,11 @@ p This tests whether TESH detects wrong outputs
 < > 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)
+
index b1f6074..d52a2ac 100644 (file)
@@ -9,6 +9,14 @@ $ cd testdir_temp
 # 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
index 7e447bc..01de5b4 100644 (file)
@@ -2,12 +2,12 @@
 
 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