changeset 1376:7dd487ddd7dc draft

Have "make test" run tests in testdir/testdir instead of same directory as command symlinks. (Makes cleanup easier.)
author Rob Landley <rob@landley.net>
date Thu, 03 Jul 2014 22:09:11 -0500
parents b6645034202b
children 7a2aec0876fe
files scripts/test.sh
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/test.sh	Thu Jul 03 20:30:52 2014 -0500
+++ b/scripts/test.sh	Thu Jul 03 22:09:11 2014 -0500
@@ -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 @@
 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 @@
   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"