Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Regexps are overkill here.
[simgrid.git] / tools / tesh / catch-all-bg-output.tesh
1 #!/usr/bin/env tesh
2
3 # Checks that background processes' output is not lost when a foreground
4 # process (or another background process) does not match its expectation.
5
6 ! expect return 2
7 < ! timeout 3
8 < & sh -c 'echo "I crash in background" && sleep 2'
9
10 < ! timeout 2
11 < & sh -c 'echo "I also crash in background" && sleep 1'
12
13 < !timeout 1
14 < $ sh -c 'echo "I crash in foreground"'
15 $ ${bindir:=.}/tesh
16 > Output of <meh.tesh:8> mismatch:
17 > --- expected
18 > +++ obtained
19 > @@ -0,0 +1 @@
20 > +I crash in foreground
21 > Test suite `meh.tesh': NOK (<meh.tesh:8> output mismatch)
22 > Output of <meh.tesh:5> mismatch:
23 > --- expected
24 > +++ obtained
25 > @@ -0,0 +1 @@
26 > +I also crash in background
27 > Test suite `meh.tesh': NOK (<meh.tesh:5> output mismatch)
28 > Test suite `meh.tesh': NOK (<meh.tesh:2> timeout after 4 sec)
29 > Output of <meh.tesh:2> mismatch:
30 > --- expected
31 > +++ obtained
32 > @@ -0,0 +1 @@
33 > +I crash in background
34 > Test suite `meh.tesh': NOK (<meh.tesh:2> output mismatch)