atexit-tests: convert to use init.sh
authorJim Meyering <meyering@redhat.com>
Mon, 5 Apr 2010 14:12:55 +0000 (16:12 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 5 Apr 2010 17:27:05 +0000 (19:27 +0200)
* 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.

ChangeLog
modules/atexit-tests
tests/test-atexit.sh

index 8a42bbc0fb013bce4023801d4ee346ec74acb8fb..7160aa026f82500575ca216a6b943d9a0305876f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2010-04-05  Jim Meyering  <meyering@redhat.com>
 
+       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.
+
        init.sh: fix typo
        * tests/init.sh: Restore omitted ":" before stderr_fileno_ initialization.
 
index 82d6ae45af4d79db97d64641ce812d424052b1f9..1d1f0d00dd558c6c6090364769d354ea1b23d6f9 100644 (file)
@@ -1,4 +1,5 @@
 Files:
+tests/init.sh
 tests/signature.h
 tests/test-atexit.sh
 tests/test-atexit.c
index 49c77291761807ae93fd7308d7da145dc1854c6a..05f23eb9832fcf92b5778c05e5a43417a28ce4b6 100755 (executable)
@@ -1,32 +1,28 @@
 #!/bin/sh
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
 
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles t-atexit.tmp"
 # Check that an atexit handler is called when main() returns normally.
 echo > t-atexit.tmp
-./test-atexit${EXEEXT}
+test-atexit
 if test -f t-atexit.tmp; then
-  exit 1
+  Exit 1
 fi
 
 # Check that an atexit handler is called when the program is left
 # through exit(0).
 echo > t-atexit.tmp
-./test-atexit${EXEEXT} 0
+test-atexit 0
 if test -f t-atexit.tmp; then
-  exit 1
+  Exit 1
 fi
 
 # Check that an atexit handler is called when the program is left
 # through exit(1).
 echo > t-atexit.tmp
-./test-atexit${EXEEXT} 1
+test-atexit 1
 if test -f t-atexit.tmp; then
-  exit 1
+  Exit 1
 fi
 
-rm -fr $tmpfiles
-
 exit 0