jehanne/qa/check
Giacomo Tesio 2481b01515 qa: introduce runners and more tests for newlib
For each test, if a script exists with the same name of the test
plus the .runner suffix, the runner is run instead of the test.

As a first example qa/lib/newlib/testsuite/atexit is run by
qa/lib/newlib/testsuite/atexit.runner.

These .runner scripts allow more complex checks of the side effects
generated by the test.
2017-04-28 00:47:12 +02:00

28 lines
398 B
Bash
Executable File

#!/cmd/rc
rfork
dir=$1
if(~ $dir '') dir=/qa
l = `{du -a /arch/$objtype/$dir|awk '{print $2}'|sort}
failed = ()
runner=.runner
for(t in $l){
if(test -x $t) {
if( test -x $t$runner ) { }
if not {
echo -n $t:
$t > /tmp/qa.log >[2=1]
st = $status
if(~ `{echo $st|field 3} PASS) {
rm /tmp/qa.log && echo PASS
}
if not { echo $st && cat /tmp/qa.log; exit $st}
}
}
}