aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/aggregate-results.sh
diff options
context:
space:
mode:
authorGravatar Michal Sojka <sojkam1@fel.cvut.cz>2010-06-10 08:48:00 +0200
committerGravatar Carl Worth <cworth@cworth.org>2010-09-16 15:56:44 -0700
commit0083854b1204f077e98b1d9c4ecfa2a4844ee716 (patch)
tree13b44620c9a59384fb610820bf7e91945ced88f4 /test/aggregate-results.sh
parent4e77148a4ba9f3b217241818ea65f282ec434e56 (diff)
Copy test framework from Git
Git uses a simple and yet powerful test framework, written in shell. The framework is easy to use for both users and developers so I think it would help if it is used in notmuch as well. This is a copy of Git's test framework from commit b6b0afdc30e066788592ca07c9a6c6936c68cc11 in git repository. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Diffstat (limited to 'test/aggregate-results.sh')
-rwxr-xr-xtest/aggregate-results.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh
new file mode 100755
index 00000000..d5bab75d
--- /dev/null
+++ b/test/aggregate-results.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+fixed=0
+success=0
+failed=0
+broken=0
+total=0
+
+for file
+do
+ while read type value
+ do
+ case $type in
+ '')
+ continue ;;
+ fixed)
+ fixed=$(($fixed + $value)) ;;
+ success)
+ success=$(($success + $value)) ;;
+ failed)
+ failed=$(($failed + $value)) ;;
+ broken)
+ broken=$(($broken + $value)) ;;
+ total)
+ total=$(($total + $value)) ;;
+ esac
+ done <"$file"
+done
+
+printf "%-8s%d\n" fixed $fixed
+printf "%-8s%d\n" success $success
+printf "%-8s%d\n" failed $failed
+printf "%-8s%d\n" broken $broken
+printf "%-8s%d\n" total $total