X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Frunalltests;h=279ced53db1eaa5c25c778b2f56fc9fa2787050c;hb=cf1205b5cbea2f0cd6ea710ec16c637df85b647c;hp=b43d42ce784bf42f115e735eacd8f4e5b7a5d001;hpb=031871c2ede845956070da603e8494690f7beb70;p=mmh diff --git a/test/runalltests b/test/runalltests index b43d42c..279ced5 100755 --- a/test/runalltests +++ b/test/runalltests @@ -1,6 +1,35 @@ #!/bin/sh -for i in `find tests -name 'test-*' -type f`; +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); +} +'