git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5803
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
> Test unit from stdin
> [stdin:3] cat
> Test unit from stdin OK
> Test unit from stdin
> [stdin:3] cat
> Test unit from stdin OK
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
p Order: out, in, cmd
< > TOTO
p Order: out, in, cmd
< > TOTO
> Test unit from stdin
> [stdin:3] cat
> Test unit from stdin OK
> Test unit from stdin
> [stdin:3] cat
> Test unit from stdin OK
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
p Order: out, cmd, in
< > TOTO
p Order: out, cmd, in
< > TOTO
> Test unit from stdin
> [stdin:2] cat
> Test unit from stdin OK
> Test unit from stdin
> [stdin:2] cat
> Test unit from stdin OK
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
p Order: in, cmd, out
< < TOTO
p Order: in, cmd, out
< < TOTO
> Test unit from stdin
> [stdin:2] cat
> Test unit from stdin OK
> Test unit from stdin
> [stdin:2] cat
> Test unit from stdin OK
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
-#! ./tesh\r# This suite builds and uses a program returning 1.\r# tesh must detect this condition and report the issue.\r\r$ rm -rf temp_testdir\r$ mkdir temp_testdir\r\r$ cd temp_testdir\r\r< #include <stdlib.h>\r< int main(void) {\r< exit(1);\r< }\r$ cat > return1.c\r\r$ gcc -o return1 return1.c\r\r! expect return $EEXITCODENOTMATCH\r< $ ./return1\r$ ../tesh --log="log.thresh:info tesh.fmt:%m%n"\r> Test unit from stdin\r> [stdin:1] ./return1\r> [stdin:1] ./return1 : NOK (returned code `1' instead `0')\r> Output of <stdin:1> so far: \r> ||\r> Test unit `stdin': NOK (<stdin:1> exit code mismatch)\r\r\r\r$ cd ..\r$ rm -rf temp_testdir\r
\ No newline at end of file
+#! ./tesh\r# This suite builds and uses a program returning 1.\r# tesh must detect this condition and report the issue.\r\r$ rm -rf temp_testdir\r$ mkdir temp_testdir\r\r$ cd temp_testdir\r\r< #include <stdlib.h>\r< int main(void) {\r< exit(1);\r< }\r$ cat > return1.c\r\r$ gcc -o return1 return1.c\r\r! expect return $EEXITCODENOTMATCH\r< $ ./return1\r$ tesh --log="log.thresh:info tesh.fmt:%m%n"\r> Test unit from stdin\r> [stdin:1] ./return1\r> [stdin:1] ./return1 : NOK (returned code `1' instead `0')\r> Output of <stdin:1> so far: \r> ||\r> Test unit `stdin': NOK (<stdin:1> exit code mismatch)\r\r\r\r$ cd ..\r$ rm -rf temp_testdir\r
\ No newline at end of file
! expect return $EUNXPSIG
< $ ./segfault
! expect return $EUNXPSIG
< $ ./segfault
-$ ../tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
> Test unit from stdin
> [stdin:1] ./segfault
> [stdin:1] `./segfault' : NOK (unexpected signal `SIGSEGV' caught)
> Test unit from stdin
> [stdin:1] ./segfault
> [stdin:1] `./segfault' : NOK (unexpected signal `SIGSEGV' caught)
> [stdin:2] Kill the process `sleep 6'
> [stdin:2] No output before timeout
> Test unit `stdin': NOK (<stdin:2> command timed out)
> [stdin:2] Kill the process `sleep 6'
> [stdin:2] No output before timeout
> Test unit `stdin': NOK (<stdin:2> command timed out)
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
< > TOTO
< < TUTU
< $ cat
< > TOTO
< < TUTU
< $ cat
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
> Test unit from stdin
> [stdin:3] cat
> [stdin:3] `cat' : NOK (outputs mismatch):
> Test unit from stdin
> [stdin:3] cat
> [stdin:3] `cat' : NOK (outputs mismatch):
> [stdin:1] cd toto
> [stdin:1] Chdir to toto failed: no such file or directory
> Test unit `stdin': NOK (<stdin:1> no such file or directory)
> [stdin:1] cd toto
> [stdin:1] Chdir to toto failed: no such file or directory
> Test unit `stdin': NOK (<stdin:1> no such file or directory)
-$ ../tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ 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.
# The next command checks that there is a testdir_temp in the upper directory,
# ie that mkdir and cd both worked.
# Ignore output of the command because we can't known the order of the execution of the Tesh files.\r
! output ignore\r
\r
# Ignore output of the command because we can't known the order of the execution of the Tesh files.\r
! output ignore\r
\r
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n" --silent --jobs --directory=examples jobs1.tesh jobs2.tesh jobs3.tesh jobs4.tesh jobs5.tesh jobs6.tesh jobs7.tesh jobs8.tesh jobs9.tesh \r
+$ tesh --log="log.thresh:info tesh.fmt:%m%n" --silent --jobs --directory=${teshexample_dir:=.} jobs1.tesh jobs2.tesh jobs3.tesh jobs4.tesh jobs5.tesh jobs6.tesh jobs7.tesh jobs8.tesh jobs9.tesh \r
< ! expect return 0\r
< > Hello Tesh\r
< $ ./job\r
< ! expect return 0\r
< > Hello Tesh\r
< $ ./job\r
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"\r
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"\r
> Test unit from stdin\r
> [stdin:3] ./job\r
> [stdin:3] ./job : NOK (returned code `0' instead `1')\r
> Test unit from stdin\r
> [stdin:3] ./job\r
> [stdin:3] ./job : NOK (returned code `0' instead `1')\r
< ! expect return 0\r
< > Hello Tesh\r
< $ ./job\r
< ! expect return 0\r
< > Hello Tesh\r
< $ ./job\r
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n" --keep-going-unit\r
+$ tesh --log="log.thresh:info tesh.fmt:%m%n" --keep-going-unit\r
> Test unit from stdin\r
> [stdin:3] ./job\r
> [stdin:3] ./job : NOK (returned code `0' instead `1')\r
> Test unit from stdin\r
> [stdin:3] ./job\r
> [stdin:3] ./job : NOK (returned code `0' instead `1')\r
! expect return $EEXITCODENOTMATCH\r
\r
# in this case the option `keep-going' is not specified so Tesh detects the error and interrupt all the folowing units.\r
! expect return $EEXITCODENOTMATCH\r
\r
# in this case the option `keep-going' is not specified so Tesh detects the error and interrupt all the folowing units.\r
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n" file1.tesh file2.tesh\r
+$ tesh --log="log.thresh:info tesh.fmt:%m%n" file1.tesh file2.tesh\r
> Test unit from file1.tesh\r
> [file1.tesh:3] ./job\r
> [file1.tesh:3] ./job : NOK (returned code `0' instead `1')\r
> Test unit from file1.tesh\r
> [file1.tesh:3] ./job\r
> [file1.tesh:3] ./job : NOK (returned code `0' instead `1')\r
! expect return $EEXITCODENOTMATCH\r
\r
# in this case the option `keep-going' is specified so, Tesh execute all the other units.\r
! expect return $EEXITCODENOTMATCH\r
\r
# in this case the option `keep-going' is specified so, Tesh execute all the other units.\r
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n" file1.tesh file2.tesh --keep-going\r
+$ tesh --log="log.thresh:info tesh.fmt:%m%n" file1.tesh file2.tesh --keep-going\r
> Test unit from file1.tesh\r
> [file1.tesh:3] ./job\r
> [file1.tesh:3] ./job : NOK (returned code `0' instead `1')\r
> Test unit from file1.tesh\r
> [file1.tesh:3] ./job\r
> [file1.tesh:3] ./job : NOK (returned code `0' instead `1')\r
< > TOTO
< < TUTU
< $ cat
< > TOTO
< < TUTU
< $ cat
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
> Test unit from stdin
> [stdin:4] cat
> (ignoring the output of <stdin:4> as requested)
> Test unit from stdin
> [stdin:4] cat
> (ignoring the output of <stdin:4> as requested)
! expect return $ESYNTAX
< ! include-file=
< ! include $include-file
! expect return $ESYNTAX
< ! include-file=
< ! include $include-file
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
> Test unit from stdin
> [stdin:1] Undefined variable `(include-file)'
> Test unit `stdin': NOK (<stdin:1> syntax error)
> Test unit from stdin
> [stdin:1] Undefined variable `(include-file)'
> Test unit `stdin': NOK (<stdin:1> syntax error)
! expect return $ESYNTAX
< ! ENOENT=300
< $ echo $ENOENT
! expect return $ESYNTAX
< ! ENOENT=300
< $ echo $ENOENT
-$ ./tesh --log="log.thresh:info tesh.fmt:%m%n"
+$ tesh --log="log.thresh:info tesh.fmt:%m%n"
> Test unit from stdin
> [stdin:1] A system variable named `(ENOENT)' already exists
> Test unit `stdin': NOK (<stdin:1> syntax error)
> Test unit from stdin
> [stdin:1] A system variable named `(ENOENT)' already exists
> Test unit `stdin': NOK (<stdin:1> syntax error)