t / aggregate-results.shon commit Merge branch 'nd/magic-pathspec' (e2bcd4f)
   1#!/bin/sh
   2
   3failed_tests=
   4fixed=0
   5success=0
   6failed=0
   7broken=0
   8total=0
   9
  10while read file
  11do
  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"
  35done
  36
  37if test -n "$failed_tests"
  38then
  39        printf "\nfailed test(s):$failed_tests\n\n"
  40fi
  41
  42printf "%-8s%d\n" fixed $fixed
  43printf "%-8s%d\n" success $success
  44printf "%-8s%d\n" failed $failed
  45printf "%-8s%d\n" broken $broken
  46printf "%-8s%d\n" total $total