qa: simple infrastructure to test output expectations

This commit is contained in:
Giacomo Tesio 2017-04-24 00:06:33 +02:00
parent 7ab8fecd80
commit 5c8200b9da
3 changed files with 18 additions and 1 deletions

View File

@ -9,13 +9,17 @@ if(~ $dir '') dir=/qa
l = `{du -a /arch/$objtype/$dir|awk '{print $2}'|sort}
failed = ()
ce=.check
for(t in $l){
if(test -x $t) {
echo -n $t:
$t > /tmp/qa.log >[2=1]
st = $status
if(~ `{echo $st|field 3} PASS) { rm /tmp/qa.log && echo PASS }
if(~ `{echo $st|field 3} PASS) {
if( test -x $t$ce ) { cp /tmp/qa.log /tmp/qa.previous.log }
rm /tmp/qa.log && echo PASS
}
if not { echo $st && cat /tmp/qa.log; exit $st}
}
}

View File

@ -0,0 +1,12 @@
#!/cmd/rc
if ( cat /tmp/qa.previous.log | grep a0cba > /dev/null ) {
rm /tmp/qa.previous.log
echo PASS
exit PASS
}
if not {
echo FAIL
cat /tmp/qa.previous.log
exit FAIL
}

View File

@ -24,6 +24,7 @@
"Post": [
"mkdir -p $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite",
"find -type f -perm /a+x -exec cp {} $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite/ \\;",
"cp *.check $JEHANNE/arch/$ARCH/qa/lib/newlib/testsuite/",
"git clean -xdf ."
],
"Pre": [