aboutsummaryrefslogtreecommitdiff
path: root/scripts/test.sh
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-07-03 22:09:11 -0500
committerRob Landley <rob@landley.net>2014-07-03 22:09:11 -0500
commit4a855d6cf62cebe40fa9fe97c7e6b9ca49f79b5b (patch)
treee9c995c623e7618c23148a8825f0372be76f4f58 /scripts/test.sh
parentfeb696ae85c34ba65da30fde9545153398b1a2de (diff)
downloadtoybox-4a855d6cf62cebe40fa9fe97c7e6b9ca49f79b5b.tar.gz
Have "make test" run tests in testdir/testdir instead of same directory as command symlinks. (Makes cleanup easier.)
Diffstat (limited to 'scripts/test.sh')
-rwxr-xr-xscripts/test.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
index 160f24f9..550c3953 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -3,7 +3,7 @@
[ -z "$TOPDIR" ] && TOPDIR="$(pwd)"
rm -rf testdir
-mkdir -p testdir
+mkdir -p testdir/testdir
if [ -z "$TEST_HOST" ]
then
@@ -16,7 +16,8 @@ then
fi
cd testdir
-PATH="$(pwd):$PATH"
+PATH="$PWD:$PATH"
+cd testdir
. "$TOPDIR"/scripts/test/testing.sh
[ -f "$TOPDIR/generated/config.h" ] && export OPTIONFLAGS=:$(echo $(sed -nr 's/^#define CFG_(.*) 1/\1/p' "$TOPDIR/generated/config.h") | sed 's/ /:/g')
@@ -31,8 +32,9 @@ else
for i in "$TOPDIR"/scripts/test/*.test
do
CMDNAME="$(echo "$i" | sed 's@.*/\(.*\)\.test@\1@')"
- if [ -h $CMDNAME ] || [ ! -z "$TEST_HOST" ]
+ if [ -h ../$CMDNAME ] || [ ! -z "$TEST_HOST" ]
then
+ cd .. && rm -rf testdir && mkdir testdir && cd testdir || exit 1
. $i
else
echo "$CMDNAME disabled"