completion: add 'symbolic-ref'
[alt-git.git] / t / aggregate-results.sh
blob6e3bcc4aec7cb922b9fc9ed4469c79b1699c76cc
1 #!/bin/sh
3 failed_tests=
4 fixed=0
5 success=0
6 failed=0
7 broken=0
8 total=0
9 missing_prereq=
11 for file in "$1"/t*-*.counts
13 while read type value
15 case $type in
16 '')
17 continue ;;
18 fixed)
19 fixed=$(($fixed + $value)) ;;
20 success)
21 success=$(($success + $value)) ;;
22 failed)
23 failed=$(($failed + $value))
24 if test $value != 0
25 then
26 testnum=$(expr "$file" : 'test-results/\(t[0-9]*\)-')
27 failed_tests="$failed_tests $testnum"
30 broken)
31 broken=$(($broken + $value)) ;;
32 total)
33 total=$(($total + $value)) ;;
34 missing_prereq)
35 missing_prereq="$missing_prereq,$value" ;;
36 esac
37 done <"$file"
38 done
40 if test -n "$missing_prereq"
41 then
42 unique_missing_prereq=$(
43 echo $missing_prereq |
44 tr -s "," "\n" |
45 grep -v '^$' |
46 sort -u |
47 paste -s -d ' ')
48 if test -n "$unique_missing_prereq"
49 then
50 printf "\nmissing prereq: $unique_missing_prereq\n\n"
54 if test -n "$failed_tests"
55 then
56 printf "\nfailed test(s):$failed_tests\n\n"
59 printf "%-8s%d\n" fixed $fixed
60 printf "%-8s%d\n" success $success
61 printf "%-8s%d\n" failed $failed
62 printf "%-8s%d\n" broken $broken
63 printf "%-8s%d\n" total $total