tomb

the crypto undertaker
git clone git://parazyd.org/tomb.git
Log | Files | Refs | README | LICENSE

aggregate-results (1476B)


      1 #!/bin/sh
      2 #
      3 # Copyright (c) 2008-2012 Git project
      4 #
      5 # This program is free software: you can redistribute it and/or modify
      6 # it under the terms of the GNU General Public License as published by
      7 # the Free Software Foundation, either version 2 of the License, or
      8 # (at your option) any later version.
      9 #
     10 # This program is distributed in the hope that it will be useful,
     11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 # GNU General Public License for more details.
     14 #
     15 # You should have received a copy of the GNU General Public License
     16 # along with this program.  If not, see http://www.gnu.org/licenses/ .
     17 
     18 failed_tests=
     19 fixed=0
     20 success=0
     21 failed=0
     22 broken=0
     23 total=0
     24 
     25 while read file; do
     26 	while read type value; do
     27 		case $type in
     28 		'')
     29 			continue ;;
     30 		fixed)
     31 			fixed=$(($fixed + $value)) ;;
     32 		success)
     33 			success=$(($success + $value)) ;;
     34 		failed)
     35 			failed=$(($failed + $value))
     36 			if test $value != 0; then
     37 				test_name=$(expr "$file" : 'test-results/\(.*\)\.[0-9]*\.counts')
     38 				failed_tests="$failed_tests $test_name"
     39 			fi
     40 			;;
     41 		broken)
     42 			broken=$(($broken + $value)) ;;
     43 		total)
     44 			total=$(($total + $value)) ;;
     45 		esac
     46 	done <"$file"
     47 done
     48 
     49 if test -n "$failed_tests"; then
     50 	printf "\nfailed test(s):$failed_tests\n\n"
     51 fi
     52 
     53 printf "%-8s%d\n" fixed $fixed
     54 printf "%-8s%d\n" success $success
     55 printf "%-8s%d\n" failed $failed
     56 printf "%-8s%d\n" broken $broken
     57 printf "%-8s%d\n" total $total