X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f2e52e70789159e58204f2cc770dc5f7a4c6498b..c00a1fd69790d8d63f76d45cabd4f013c1a61eea:/tools/tesh2/examples/keep-going-unit.tesh diff --git a/tools/tesh2/examples/keep-going-unit.tesh b/tools/tesh2/examples/keep-going-unit.tesh new file mode 100644 index 0000000000..22ce9dc2a8 --- /dev/null +++ b/tools/tesh2/examples/keep-going-unit.tesh @@ -0,0 +1,90 @@ +#! ./tesh + +D this Tesh unit tests the option of the command line `--keep-going' + +< #include +< #include +< +< int +< main(int argc, char* argv[]) +< { +< printf("Hello Tesh\n"); +< +< return EXIT_SUCCESS; +< } +< +$ cat > job.c + +$ gcc -o job job.c + +# in this case the option keep-going-unit is not specified so only the first command is executed. +! expect return $EEXITCODENOTMATCH + +< ! expect return 1 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' +> Test unit from stdin +> [stdin:3] ./job +> [stdin:3] ./job : NOK (returned code `0' instead `1') +> Output of so far: +> ||Hello Tesh +> || +> Test unit `(stdin)' : NOK (exit code mismatch) + + +# in this case the option keep-going-unit is specified so, all the command are executed. +! expect return $EEXITCODENOTMATCH + +< ! expect return 1 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +< +< ! expect return 0 +< > Hello Tesh +< $ ./job +$ ./tesh --log='log.thresh:info tesh.fmt:%m%n' --keep-going-unit +> Test unit from stdin +> [stdin:3] ./job +> [stdin:3] ./job : NOK (returned code `0' instead `1') +> Output of so far: +> ||Hello Tesh +> || +> [stdin:7] ./job +> [stdin:11] ./job +> [stdin:15] ./job +> [stdin:19] ./job +> Test unit `(stdin)' : NOK (exit code mismatch) + + +$ rm -f job + +$ rm -f job.c \ No newline at end of file