pty: Activate the signature wrapper of forkpty.
[gnulib.git] / tests / test-atexit.sh
1 #!/bin/sh
2 : ${srcdir=.}
3 . "$srcdir/init.sh"; path_prepend_ .
4
5 # Check that an atexit handler is called when main() returns normally.
6 echo > t-atexit.tmp
7 test-atexit
8 if test -f t-atexit.tmp; then
9   Exit 1
10 fi
11
12 # Check that an atexit handler is called when the program is left
13 # through exit(0).
14 echo > t-atexit.tmp
15 test-atexit 0
16 if test -f t-atexit.tmp; then
17   Exit 1
18 fi
19
20 # Check that an atexit handler is called when the program is left
21 # through exit(1).
22 echo > t-atexit.tmp
23 test-atexit 1
24 if test -f t-atexit.tmp; then
25   Exit 1
26 fi
27
28 Exit 0