jehanne/qa/check
Giacomo Tesio 001069aa7b libposix: deep refactor; add sys/posixly command
With these changes, libposix (and newlib) can run MirBSD Korn Shell.
2017-12-18 23:02:36 +01:00

39 lines
681 B
Bash
Executable File

#!/cmd/rc
rfork
if( ! test -d /dev/posix ){
sys/posixly -d /tmp/qa-posixly.log -p $PID &
# sys/ctrace -o /tmp/posixly.trace $APID &
}
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
switch( `{echo $st|field 3} ){
case PASS
rm /tmp/qa.log && echo PASS
case SKIP
echo -n ' SKIP: ' && cat /tmp/qa.log && rm /tmp/qa.log
case FAIL
echo $st && cat /tmp/qa.log; exit $st
case *
echo Unexpected test result: $st && cat /tmp/qa.log; exit $st
}
}
}
}