Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix usage of testsuite_name.
authoragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 1 Dec 2010 22:00:27 +0000 (22:00 +0000)
committeragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 1 Dec 2010 22:00:27 +0000 (22:00 +0000)
Do not duplicate string for testuite_name when tesh file is read
from stdin, and pass testsuite_name to handle_suite.

Also update tesh tesh files for s/stdin/(stdin)/.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8841 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/set-ignore-output.tesh
tools/tesh/tesh.c
tools/tesh/tesh.h

index 80cc596..14db63d 100644 (file)
@@ -6,7 +6,7 @@ p Order: in, out, cmd
 < > TOTO
 < $ cat
 > Test suite from stdin
-> [stdin:3] cat
+> [(stdin):3] cat
 > Test suite from stdin OK
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 
@@ -15,7 +15,7 @@ p Order: out, in, cmd
 < < TOTO
 < $ cat
 > Test suite from stdin
-> [stdin:3] cat
+> [(stdin):3] cat
 > Test suite from stdin OK
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 
@@ -24,7 +24,7 @@ p Order: out, cmd, in
 < $ cat
 < < TOTO
 > Test suite from stdin
-> [stdin:2] cat
+> [(stdin):2] cat
 > Test suite from stdin OK
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 
@@ -33,7 +33,7 @@ p Order: in, cmd, out
 < $ cat
 < > TOTO
 > Test suite from stdin
-> [stdin:2] cat
+> [(stdin):2] cat
 > Test suite from stdin OK
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 
@@ -42,7 +42,7 @@ p Order: cmd, out, in
 < > TOTO
 < < TOTO
 > Test suite from stdin
-> [stdin:1] cat
+> [(stdin):1] cat
 > Test suite from stdin OK
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 
@@ -51,7 +51,7 @@ p Order: cmd, in, out
 < < TOTO
 < > TOTO
 > Test suite from stdin
-> [stdin:1] cat
+> [(stdin):1] cat
 > Test suite from stdin OK
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 
index 20784e7..b7d39c5 100644 (file)
@@ -18,9 +18,9 @@ $ gcc -o return1 return1.c
 < $ ./return1
 $ ../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: 
+> [(stdin):1] ./return1
+> Test suite `(stdin)': NOK (<(stdin):1> returned code 1)
+> Output of <(stdin):1> so far: 
 > ||
 
 $ cd ..
index c9f9fec..2b0436f 100644 (file)
@@ -19,9 +19,9 @@ $ gcc -o segfault segfault.c
 < $ ./segfault
 $ ../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: 
+> [(stdin):1] ./segfault
+> Test suite `(stdin)': NOK (<(stdin):1> got signal SIGSEGV)
+> Output of <(stdin):1> so far: 
 > ||
 
 $ cd ..
index d4c6f14..ebab52a 100644 (file)
@@ -7,8 +7,8 @@
 < ! timeout 1
 < $ sleep 6
 > 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)
+> [(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 8fa8bce..135ae4c 100644 (file)
@@ -8,9 +8,9 @@ p This tests whether TESH detects wrong outputs
 < $ cat
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 > Test suite from stdin
-> [stdin:3] cat
-> Output of <stdin:3> mismatch:
+> [(stdin):3] cat
+> Output of <(stdin):3> mismatch:
 > - TOTO
 > + TUTU
-> Test suite `(stdin)': NOK (<stdin:3> output mismatch)
+> Test suite `(stdin)': NOK (<(stdin):3> output mismatch)
 
index 6697a40..af80e58 100644 (file)
@@ -8,6 +8,6 @@ p This tests whether TESH accepts to ignore command output
 < $ cat
 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'
 > Test suite from stdin
-> [stdin:4] cat
-> (ignoring the output of <stdin:4> as requested)
+> [(stdin):4] cat
+> (ignoring the output of <(stdin):4> as requested)
 > Test suite from stdin OK
index 628f856..f4a3c89 100644 (file)
@@ -21,7 +21,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(tesh, "TEst SHell utility");
 /*** Options ***/
 int timeout_value = 5;          /* child timeout value */
 
-char *testsuite_name;
+const char *testsuite_name;
 static void handle_line(const char *filepos, char *line)
 {
   /* Search end */
@@ -241,8 +241,8 @@ int main(int argc, char *argv[])
   /* Find the description file */
   if (argc == 1) {
     INFO0("Test suite from stdin");
-    testsuite_name = xbt_strdup("(stdin)");
-    handle_suite("stdin", stdin);
+    testsuite_name = "(stdin)";
+    handle_suite(testsuite_name, stdin);
     INFO0("Test suite from stdin OK");
 
   } else {
index d393903..8f73c1c 100644 (file)
@@ -25,7 +25,7 @@ const char *signal_name(unsigned int got, char *expected);
 int timeout_value;              /* child timeout value */
 
 rctx_t rctx;
-char *testsuite_name;
+const char *testsuite_name;
 
 
 /* Environment related definitions */