X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Finit.sh;h=bc82d69a9228994c36eb27c1245f281c971c3dc0;hb=880d107;hp=286bbf191c3b37c2c8699b282687cae3b250bdcf;hpb=0ae8d6338cc686b1fca0da26aefadebc0875cdf9;p=gnulib.git diff --git a/tests/init.sh b/tests/init.sh index 286bbf191..bc82d69a9 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -77,7 +77,7 @@ Exit () { set +e; (exit $1); exit $1; } warn_() { echo "$@" 1>&$stderr_fileno_; } fail_() { warn_ "$ME_: failed test: $@"; Exit 1; } skip_() { warn_ "$ME_: skipped test: $@"; Exit 77; } -framework_failure_() { warn_ "$ME_: set-up failure: $@"; Exit 1; } +framework_failure_() { warn_ "$ME_: set-up failure: $@"; Exit 99; } # We require $(...) support unconditionally. # We require a few additional shell features only when $EXEEXT is nonempty, @@ -255,9 +255,9 @@ setup_() || fail_ "failed to create temporary directory in $initial_cwd_" cd "$test_dir_" - # These trap statements ensure that the temporary directory, $test_dir_, - # is removed upon exit as well as upon receipt of any of the listed signals. - trap remove_tmp_ 0 + # This trap statement, along with a trap on 0 below, ensure that the + # temporary directory, $test_dir_, is removed upon exit as well as + # upon receipt of any of the listed signals. for sig_ in 1 2 3 13 15; do eval "trap 'Exit $(expr $sig_ + 128)' $sig_" done @@ -385,3 +385,6 @@ test -f "$srcdir/init.cfg" \ && . "$srcdir/init.cfg" setup_ "$@" +# This trap is here, rather than in the setup_ function, because some +# shells run the exit trap at shell function exit, rather than script exit. +trap remove_tmp_ 0