Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into CRTP
[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 > Test suite from stdin
17 > [(stdin):8] sh -c 'echo "I crash in foreground"'
18 > Output of <(stdin):8> mismatch:
19 > --- expected
20 > +++ obtained
21 > @@ -0,0 +1 @@
22 > +I crash in foreground
23 > Test suite `(stdin)': NOK (<(stdin):8> output mismatch)
24 > [(stdin):5] sh -c 'echo "I also crash in background" && sleep 1'
25 > Output of <(stdin):5> mismatch:
26 > --- expected
27 > +++ obtained
28 > @@ -0,0 +1 @@
29 > +I also crash in background
30 > Test suite `(stdin)': NOK (<(stdin):5> output mismatch)
31 > [(stdin):2] sh -c 'echo "I crash in background" && sleep 2'
32 > Output of <(stdin):2> mismatch:
33 > --- expected
34 > +++ obtained
35 > @@ -0,0 +1 @@
36 > +I crash in background
37 > Test suite `(stdin)': NOK (<(stdin):2> output mismatch)