Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[tesh] Write self-tests in perl (we may not have cc at hand)
[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 < kill 'SEGV', $$;
10 $ mkfile segfault.pl
11
12 ! expect signal SIGSEGV
13 $ perl segfault.pl
14
15 ! expect return 15
16 < $ perl segfault.pl
17 $ ../tesh --enable-coverage
18 > Enable coverage
19 > Test suite from stdin
20 > [(stdin):1] perl segfault.pl
21 > Test suite `(stdin)': NOK (<(stdin):1> got signal SIGSEGV)
22 > <(stdin):1> No output so far.
23
24 $ cd ..
25 $ rm -rf temp_testdir-catch-signal