changeset 101:e6cdee24d6c3

Improve exit handling when we have a server background process. Arrange the exit to kill off the most recently started background process, if we have at least one such.
author mas01cr
date Thu, 04 Oct 2007 10:17:33 +0000
parents 3720f5a78f6e
children 9967d4dc6b1f
files tests/test-utils.sh
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-utils.sh	Thu Oct 04 09:48:44 2007 +0000
+++ b/tests/test-utils.sh	Thu Oct 04 10:17:33 2007 +0000
@@ -1,5 +1,7 @@
 # no shebang line: this file should be sourced by run-test.sh files
 
+set -E
+
 trap "exit 1" ERR
 
 if [ -z ${AUDIODB} ]; then
@@ -53,6 +55,7 @@
   $1 -s $2 &
   # HACK: deal with race on process creation
   sleep 1
+  trap 'kill $!; exit 1' ERR
 }
 
 stop_server() {