From 387edf547eb09b27ca6d49772eb048d729f09cf4 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 20 Sep 2014 13:09:14 -0500 Subject: Move testsuite out of scripts/test into its own top level tests directory, and make ctrl-c kill "make test" more reliably. --- scripts/test.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts/test.sh') diff --git a/scripts/test.sh b/scripts/test.sh index 550c3953..81d9f346 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -2,34 +2,36 @@ [ -z "$TOPDIR" ] && TOPDIR="$(pwd)" -rm -rf testdir -mkdir -p testdir/testdir +trap 'kill $(jobs -p) 2>/dev/null; exit 1' INT + +rm -rf generated/testdir +mkdir -p generated/testdir/testdir if [ -z "$TEST_HOST" ] then if [ $# -ne 0 ] then - PREFIX=testdir/ scripts/single.sh "$@" || exit 1 + PREFIX=generated/testdir/ scripts/single.sh "$@" || exit 1 else - make install_flat PREFIX=testdir || exit 1 + make install_flat PREFIX=generated/testdir || exit 1 fi fi -cd testdir +cd generated/testdir PATH="$PWD:$PATH" cd testdir -. "$TOPDIR"/scripts/test/testing.sh +. "$TOPDIR"/scripts/runtest.sh [ -f "$TOPDIR/generated/config.h" ] && export OPTIONFLAGS=:$(echo $(sed -nr 's/^#define CFG_(.*) 1/\1/p' "$TOPDIR/generated/config.h") | sed 's/ /:/g') if [ $# -ne 0 ] then for i in "$@" do - . "$TOPDIR"/scripts/test/$i.test + . "$TOPDIR"/tests/$i.test done else - for i in "$TOPDIR"/scripts/test/*.test + for i in "$TOPDIR"/tests/*.test do CMDNAME="$(echo "$i" | sed 's@.*/\(.*\)\.test@\1@')" if [ -h ../$CMDNAME ] || [ ! -z "$TEST_HOST" ] -- cgit v1.2.3