diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-09-16 19:51:08 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-09-16 19:51:08 +0100 |
commit | ad8f502755a35afb4c784e77d3e9b660d3cdb520 (patch) | |
tree | 49d5d44927ad97f23c62008266f865362295fd52 | |
parent | fcf2923352d3438d026503efc1766d0b98cf3865 (diff) |
Do some awesome shell scripting to detect when glean tests have regressed
-rwxr-xr-x | glean-test.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/glean-test.sh b/glean-test.sh index 211262d..5521a08 100755 --- a/glean-test.sh +++ b/glean-test.sh @@ -2,6 +2,25 @@ echo >/tmp/glean.log xinit `pwd`/glean-wrapper -- :99 -multiwindow >/tmp/startx.log 2>&1 cat /tmp/glean.log + +# crudely summarize pass/fail statistics PASS=`grep -c "PASS " /tmp/glean.log` FAIL=`grep -c "FAIL " /tmp/glean.log` echo "PASS: $PASS FAIL: $FAIL" + +# compare with previous statistics +PREV_PASS=`cat .glean.pass` +PREV_FAIL=`cat .glean.fail` +EXITCODE=0 + +if [ $PASS -lt $PREV_PASS ] || [ $FAIL -lt $PREV_FAIL ] ; then + # report an error + echo "Error: results worse than previous run PASS: $PREV_PASS FAIL: $PREV_FAIL" + EXITCODE=1 +else + # record pass/fail counts for checking next time + echo $PASS >.glean.pass + echo $FAIL >.glean.fail +fi + +exit $EXITCODE |