Fix the test suite script so it actually works and actually flags
authorEric Andersen <andersen@codepoet.org>
Tue, 6 Apr 2004 00:41:39 +0000 (00:41 -0000)
committerEric Andersen <andersen@codepoet.org>
Tue, 6 Apr 2004 00:41:39 +0000 (00:41 -0000)
all errors as such.  Make verbose mode exit on FAIL and provide a
printout of the failed test run.

testsuite/runtest

index 2cf85f5d8ee48cdb7f597c35ff25388876f71d07..f57f464ee789384a1a9dffd450d0c2171b569019 100755 (executable)
@@ -26,6 +26,7 @@ run_applet_testcase ()
 
        local status=0
        local X=
+       local RES=
 
        local uc_applet=$(echo $applet | tr a-z A-Z)
        local testname=$(basename $testcase)
@@ -48,14 +49,22 @@ run_applet_testcase ()
                X=X
        fi
 
-       mkdir tmp
+       rm -rf tmp
+       mkdir -p tmp
        pushd tmp >/dev/null
 
-       if . ../$testcase >/dev/null 2>&1; then
-               show_result ${X}PASS $testname
+       sh -x -e ../$testcase >.logfile.txt 2>&1
+
+       if [ $? != 0 ] ; then
+               show_result ${X}FAIL $testname
+               if [ "$verbose" == 1 ]; then
+                       cat .logfile.txt
+                       exit 1;
+               fi;
                status=$?
        else
-               show_result ${X}FAIL $testname
+               show_result ${X}PASS $testname
+               rm -f .logfile.txt
                status=$?
        fi