Fresco/Fresco-Test/scripts run_tests.sh,1.3,1.4

Tobias Hunger <[email protected]> Mon, 04 Aug 2003 13:59:39 -0500
Newsgroups gmane.comp.video.fresco.cvs
Message-ID <[email protected]>
Update of /cvs/fresco/Fresco/Fresco-Test/scripts
In directory purcel:/tmp/cvs-serv20843/Fresco-Test/scripts

Modified Files:
	run_tests.sh 
Log Message:
* Add a unit test for characters without normalization: Those should
  stay unchanged in all norms.
* Add FRESCO_TESTS environment var to specify whith test routines are
  run by run_tests.sh in all tests. Run all tests if this variable is
  unset.


Index: run_tests.sh
===================================================================
RCS file: /cvs/fresco/Fresco/Fresco-Test/scripts/run_tests.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- run_tests.sh	23 Apr 2003 10:45:22 -0000	1.3
+++ run_tests.sh	4 Aug 2003 18:59:36 -0000	1.4
@@ -1,7 +1,11 @@
 #!/bin/sh
 
-# This script runs all tests given on the commandline and returns an
-# exitcode of 0 if all tests passed or 1 if one or more tests failed.
+# This script runs all tests of all test programs given on the commandline
+# and returns an exitcode of 0 if all tests passed or 1 if one or more tests
+# failed.
+#
+# Additionally you can specify tests to run with the FRESCO_TESTS environment
+# variable. Make sure all test programs know the test routines given there!
 #
 # It is meant as a quick and dirty way to run our tests from a Makefile
 # without needing to register all tests with qmtest manually.
@@ -10,10 +14,12 @@
 
 ALL_PASSED=1
 
-function run_test()
+
+
+run_test ()
 {
     TESTPROG="$1"
-    for TEST in `$TESTPROG list` ; do
+    for TEST in ${FRESCO_TESTS:-`$TESTPROG list`} ; do
         if ! $TESTPROG run $TEST | tee -a $TEST_LOG | egrep -q '^Result:[[:space:]]+PASS'; then
             echo "Test $TEST in $TESTPROG FAILED!"
             ALL_PASSED=0;
@@ -32,7 +38,7 @@
     run_test "$CURRENT"
 done
 
-if [ ALL_PASSED == 0 ]; then
+if [ $ALL_PASSED -eq 0 ]; then
     exit 1
 fi