Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / tools / tesh / catch-signal.tesh
1 #! ./tesh
2 # This suite builds and uses a program raising a segfault, ie a program dying
3 # of SIGSEV. tesh must detect this condition and report the issue.
4
5 $ rm -rf temp_testdir-catch-signal
6 $ mkdir temp_testdir-catch-signal
7
8 $ cd temp_testdir-catch-signal
9 < #include <stdlib.h>
10 < int main(void) {
11 <   char *A=NULL;
12 <   *A = 1;
13 < }
14 $ mkfile segfault.c
15
16 $ cc -o segfault segfault.c
17
18 ! expect return 15
19 < $ ./segfault
20 $ ../tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n'
21 > Enable coverage
22 > Test suite from stdin
23 > [(stdin):1] ./segfault
24 > Test suite `(stdin)': NOK (<(stdin):1> got signal SIGSEGV)
25 > Output of <(stdin):1> so far:
26 > ||
27
28 $ cd ..
29 $ rm -rf temp_testdir-catch-signal