X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=test%2Frunalltests;h=c06481ef66f1f6b0f63773bd613ff33802c5df9f;hp=b43d42ce784bf42f115e735eacd8f4e5b7a5d001;hb=88b2142594d5ea1e8385dae5eca81eed1018c555;hpb=031871c2ede845956070da603e8494690f7beb70 diff --git a/test/runalltests b/test/runalltests index b43d42c..c06481e 100755 --- a/test/runalltests +++ b/test/runalltests @@ -1,6 +1,37 @@ #!/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 | LC_ALL=C sort`; 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); +} +' + +exit `test "$failed" -eq 0`