Browse Source

run tests script now filters, also shuts down

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>
Graham MacDonald 1 year ago
parent
commit
7cf336736e
2 changed files with 12 additions and 8 deletions
  1. 9 7
      rc/bin/tests/runall
  2. 3 1
      rc/bin/tests/runalltofile

+ 9 - 7
rc/bin/tests/runall

@@ -2,15 +2,17 @@
 
 # Script to run all tests in 'tests'.  If any test fails, this script fails.
 
-tests=/bin/regress/^(fpuexcept fpunote)
-
-echo 1..$#tests
+# Skip folders or files beginning in '_'
+tests=`{du -a /bin/regress | awk '{print $2}' | grep -v /_}
 
 finalstatus=PASS
-for (test in $tests) {
-	output=PASS
-	$test >[2=1] >/dev/null || {output='FAIL - '^$status; finalstatus=FAIL}
-	echo $output
+for (file in $tests) {
+	if (test -f $file && test -x $file) {
+		$file >[2=1] >/dev/null
+		teststatus = $status
+		if (! ~ $teststatus '') { echo FAIL $file $teststatus }
+		if not { echo PASS $file; finalstatus=FAIL }
+	}
 }
 
 if (~ $finalstatus FAIL) exit $finalstatus

+ 3 - 1
rc/bin/tests/runalltofile

@@ -1,8 +1,10 @@
 #!/bin/rc
 
-# Script to run all tests and output the results to file
+# Script to run all tests, output the results to file and shutdown
 
 file=/tmp/runallresults.txt
 rm -f $file
 tests/runall >[2=1] > $file
 echo 'DONE' >> $file
+
+acpi/shutdown