diff options
author | Rob Landley <rob@landley.net> | 2014-09-20 13:09:14 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-09-20 13:09:14 -0500 |
commit | 387edf547eb09b27ca6d49772eb048d729f09cf4 (patch) | |
tree | 59d482f33735690cab6d90723393afa1e2c8dce5 /scripts/test.sh | |
parent | d3df423a6cde0c6282658ff628574771d3824d71 (diff) | |
download | toybox-387edf547eb09b27ca6d49772eb048d729f09cf4.tar.gz |
Move testsuite out of scripts/test into its own top level tests directory, and make ctrl-c kill "make test" more reliably.
Diffstat (limited to 'scripts/test.sh')
-rwxr-xr-x | scripts/test.sh | 18 |
1 files changed, 10 insertions, 8 deletions
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" ] |