Hash :
5c92acef
Author :
Date :
2010-04-05T16:12:55
atexit-tests: convert to use init.sh * modules/atexit-tests (Files): Add tests/init.sh. * tests/test-atexit.sh: Invoke "$srcdir/init.sh" and path_prepend_. Use Exit, not exit. Remove uses of $EXEEXT and "./" to run a program in the current dir.
#!/bin/sh
: ${srcdir=.}
. "$srcdir/init.sh"; path_prepend_ .
# Check that an atexit handler is called when main() returns normally.
echo > t-atexit.tmp
test-atexit
if test -f t-atexit.tmp; then
Exit 1
fi
# Check that an atexit handler is called when the program is left
# through exit(0).
echo > t-atexit.tmp
test-atexit 0
if test -f t-atexit.tmp; then
Exit 1
fi
# Check that an atexit handler is called when the program is left
# through exit(1).
echo > t-atexit.tmp
test-atexit 1
if test -f t-atexit.tmp; then
Exit 1
fi
exit 0