From 0083854b1204f077e98b1d9c4ecfa2a4844ee716 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 10 Jun 2010 08:48:00 +0200 Subject: 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 --- test/aggregate-results.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 test/aggregate-results.sh (limited to 'test/aggregate-results.sh') 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 -- cgit v1.2.3