Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
some new files used to check Tesh
[simgrid.git] / tools / tesh2 / examples / keep-going-unit.tesh
1 #! ./tesh\r
2 \r
3 D this Tesh unit tests the option of the command line `--keep-going'\r
4 \r
5 < #include <stdlib.h>\r
6 < #include <stdio.h>\r
7\r
8 < int\r
9 < main(int argc, char* argv[])\r
10 < {\r
11 <       printf("Hello Tesh\n");\r
12 <       \r
13 <       return EXIT_SUCCESS;\r
14 < }\r
15\r
16 $ cat > job.c\r
17 \r
18 $ gcc -o job job.c\r
19 \r
20 # in this case the option keep-going-unit is not specified so only the first command is executed.\r
21 ! expect return $EEXITCODENOTMATCH\r
22 \r
23 < ! expect return 1\r
24 < > Hello Tesh\r
25 < $ ./job\r
26\r
27 < ! expect return 0\r
28 < > Hello Tesh\r
29 < $ ./job\r
30\r
31 < ! expect return 0\r
32 < > Hello Tesh\r
33 < $ ./job\r
34\r
35 < ! expect return 0\r
36 < > Hello Tesh\r
37 < $ ./job\r
38\r
39 < ! expect return 0\r
40 < > Hello Tesh\r
41 < $ ./job\r
42 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'\r
43 > Test unit from stdin\r
44 > [stdin:3] ./job\r
45 > [stdin:3] ./job : NOK (returned code `0' instead `1')\r
46 > Output of <stdin:3> so far: \r
47 > ||Hello Tesh\r
48 > ||\r
49 > Test unit `(stdin)' : NOK (exit code mismatch)\r
50 \r
51 \r
52 # in this case the option keep-going-unit is specified so, all the command are executed.\r
53 ! expect return $EEXITCODENOTMATCH\r
54 \r
55 < ! expect return 1\r
56 < > Hello Tesh\r
57 < $ ./job\r
58\r
59 < ! expect return 0\r
60 < > Hello Tesh\r
61 < $ ./job\r
62\r
63 < ! expect return 0\r
64 < > Hello Tesh\r
65 < $ ./job\r
66\r
67 < ! expect return 0\r
68 < > Hello Tesh\r
69 < $ ./job\r
70\r
71 < ! expect return 0\r
72 < > Hello Tesh\r
73 < $ ./job\r
74 $ ./tesh --log='log.thresh:info tesh.fmt:%m%n'  --keep-going-unit\r
75 > Test unit from stdin\r
76 > [stdin:3] ./job\r
77 > [stdin:3] ./job : NOK (returned code `0' instead `1')\r
78 > Output of <stdin:3> so far: \r
79 > ||Hello Tesh\r
80 > ||\r
81 > [stdin:7] ./job\r
82 > [stdin:11] ./job\r
83 > [stdin:15] ./job\r
84 > [stdin:19] ./job\r
85 > Test unit `(stdin)' : NOK (exit code mismatch)\r
86 \r
87 \r
88 $ rm -f job\r
89 \r
90 $ rm -f job.c