Tests for module 'uninorm/composition'.
[gnulib.git] / tests / test-atexit.sh
1 #!/bin/sh
2
3 tmpfiles=""
4 trap 'rm -fr $tmpfiles' 1 2 3 15
5
6 tmpfiles="$tmpfiles t-atexit.tmp"
7 # Check that an atexit handler is called when main() returns normally.
8 echo > t-atexit.tmp
9 ./test-atexit${EXEEXT}
10 if test -f t-atexit.tmp; then
11   exit 1
12 fi
13
14 # Check that an atexit handler is called when the program is left
15 # through exit(0).
16 echo > t-atexit.tmp
17 ./test-atexit${EXEEXT} 0
18 if test -f t-atexit.tmp; then
19   exit 1
20 fi
21
22 # Check that an atexit handler is called when the program is left
23 # through exit(1).
24 echo > t-atexit.tmp
25 ./test-atexit${EXEEXT} 1
26 if test -f t-atexit.tmp; then
27   exit 1
28 fi
29
30 rm -fr $tmpfiles
31
32 exit 0