X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=test%2Frunalltests;fp=test%2Frunalltests;h=279ced53db1eaa5c25c778b2f56fc9fa2787050c;hp=0497c52b4f290664f7faf37efe93a224128362f7;hb=92009746ef66e8a9a9dc6643845e839e0debaf18;hpb=1b97b10a0b0455edff975e23e2783c0c0b4b60d4 diff --git a/test/runalltests b/test/runalltests index 0497c52..279ced5 100755 --- a/test/runalltests +++ b/test/runalltests @@ -1,7 +1,35 @@ #!/bin/sh +passed=0 +failed=0 +skipped=0 + # Note that we ignore *~ files as these are probably editor backups for i in `find tests -name 'test-*[!~]' -type f`; do - ./runtest $i + ./runtest "$i" + case $? in + 0) passed="`expr $passed + 1`" ;; + 1) failed="`expr $failed + 1`" ;; + 2) skipped="`expr $skipped + 1`" ;; + esac done + +awk -v passed="$passed" -v failed="$failed" -v skipped="$skipped" ' +BEGIN { + sum = passed + failed + skipped; + if (failed > 0) { + smilie = ":-(" + } else if (sum == passed) { + smilie = ":-)" + } else { + # we either passed the tests or managed to sneak around them + smilie = ";-)" + } + printf("\n%s %s\n", "SUMMARY", smilie); + printf("%-12s %4d = %d%%\n", "Passed", passed, passed/sum*100); + printf("%-12s %4d = %d%%\n", "Failed", failed, failed/sum*100); + printf("%-12s %4d = %d%%\n", "Skipped", skipped, skipped/sum*100); + printf("%-12s %4d\n", "Total", sum); +} +'