Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
keep up with lastest diff computation changes
[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
6 $ mkdir temp_testdir
7
8 $ cd temp_testdir
9 < #include <stdlib.h>
10 < int main(void) {
11 <   char *A=NULL;
12 <   *A = 1;
13 < }
14 $ cat > segfault.c
15
16 $ gcc -o segfault segfault.c
17
18 ! expect return 15
19 < $ ./segfault
20 $ ../tesh
21 > [0.000000] [tesh/INFO] Test suite from stdin
22 > [0.000000] [tesh/INFO] [stdin:1] ./segfault
23 > [0.000000] run_context.c:350: [tesh/ERROR] Child "./segfault" got signal SIGSEGV.
24
25 $ cd ..
26 $ rm -rf temp_testdir