From: Miklos Vajna Date: Sun, 08 Jun 2008 00:18:11 GMT Subject: [PATCH] A simple script to parse the results from the testcases Message-ID: <1212884291-13847-1-git-send-email-vmiklos@frugalware.org> In-Reply-To: <1210584832-16402-3-git-send-email-srabbelier@gmail.com> This is a simple script that aggregates key:value pairs in a file. Signed-off-by: Miklos Vajna --- On Mon, May 12, 2008 at 11:33:51AM +0200, Sverre Rabbelier wrote: > This is a simple script that aggregates key:value pairs in a file. Here is a shell version. Just to avoid python. t/key_value_parser.sh | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) create mode 100755 t/key_value_parser.sh diff --git a/t/key_value_parser.sh b/t/key_value_parser.sh new file mode 100755 index 0000000..db568fe --- /dev/null +++ b/t/key_value_parser.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +input="/tmp/git-test-results" + +fixed=0 +success=0 +failed=0 +broken=0 +total=0 + +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 < $input + +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 -- 1.5.6.rc0.dirty