Merge branch 'jt/upload-pack-error-report' into maint
[git] / t / aggregate-results.sh
1 #!/bin/sh
2
3 failed_tests=
4 fixed=0
5 success=0
6 failed=0
7 broken=0
8 total=0
9
10 while read file
11 do
12         while read type value
13         do
14                 case $type in
15                 '')
16                         continue ;;
17                 fixed)
18                         fixed=$(($fixed + $value)) ;;
19                 success)
20                         success=$(($success + $value)) ;;
21                 failed)
22                         failed=$(($failed + $value))
23                         if test $value != 0
24                         then
25                                 testnum=$(expr "$file" : 'test-results/\(t[0-9]*\)-')
26                                 failed_tests="$failed_tests $testnum"
27                         fi
28                         ;;
29                 broken)
30                         broken=$(($broken + $value)) ;;
31                 total)
32                         total=$(($total + $value)) ;;
33                 esac
34         done <"$file"
35 done
36
37 if test -n "$failed_tests"
38 then
39         printf "\nfailed test(s):$failed_tests\n\n"
40 fi
41
42 printf "%-8s%d\n" fixed $fixed
43 printf "%-8s%d\n" success $success
44 printf "%-8s%d\n" failed $failed
45 printf "%-8s%d\n" broken $broken
46 printf "%-8s%d\n" total $total