summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2006-01-13 20:13:21 +0000
committerRoland McGrath <roland@redhat.com>2006-01-13 20:13:21 +0000
commitc40f58a64aec04758e9c50eda1b556789f74bdb9 (patch)
tree041d19811c3914d8c791faf1dbf0ef3a64e4421a
parent808b412e2c26333238e8bb5e2cae972ccccd7726 (diff)
downloadelfutils-c40f58a64aec04758e9c50eda1b556789f74bdb9.tar.gz
2006-01-13 Roland McGrath <roland@redhat.com>
* run-native-test.sh: Do kill -9 and reap explicitly at end, since bash 3.1 whines when it's done in the trap 0 handler.
-rw-r--r--tests/ChangeLog5
-rwxr-xr-xtests/run-native-test.sh23
2 files changed, 25 insertions, 3 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 7ea768be..28207cf8 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-13 Roland McGrath <roland@redhat.com>
+
+ * run-native-test.sh: Do kill -9 and reap explicitly at end, since
+ bash 3.1 whines when it's done in the trap 0 handler.
+
2006-01-11 Roland McGrath <roland@redhat.com>
* testfile26.bz2: New data file.
diff --git a/tests/run-native-test.sh b/tests/run-native-test.sh
index d8202146..2a5f3886 100755
--- a/tests/run-native-test.sh
+++ b/tests/run-native-test.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005 Red Hat, Inc.
+# Copyright (C) 2005, 2006 Red Hat, Inc.
#
# This program is Open Source software; you can redistribute it and/or
# modify it under the terms of the Open Software License version 1.0 as
@@ -25,11 +25,21 @@ tempfiles native.c native
echo 'main () { while (1) pause (); }' > native.c
native=0
+kill_native()
+{
+ test $native -eq 0 || {
+ kill -9 $native 2> /dev/null || :
+ wait $native 2> /dev/null || :
+ }
+ native=0
+}
+
native_cleanup()
{
- test $native -eq 0 || kill -9 $native || :
- rm -f $remove_files
+ kill_native
+ test_cleanup
}
+
trap native_cleanup 0 1 2 15
for cc in "$HOSTCC" "$HOST_CC" cc gcc "$CC"; do
@@ -56,3 +66,10 @@ native_test()
native_test ./allregs
native_test ./funcretval
+
+# We do this explicitly rather than letting the trap 0 cover it,
+# because as of version 3.1 bash prints the "Killed" report for
+# $native when we do the kill inside the exit handler.
+native_cleanup
+
+exit 0