From 9e51706711de4b036ec47bc1b171bccee7f40028 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Sat, 1 Dec 2007 23:57:17 +0100 Subject: Implement git-check-commit-msg --- git-check-commit-msg/run-tests.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 git-check-commit-msg/run-tests.sh (limited to 'git-check-commit-msg/run-tests.sh') diff --git a/git-check-commit-msg/run-tests.sh b/git-check-commit-msg/run-tests.sh new file mode 100755 index 0000000..d3da61c --- /dev/null +++ b/git-check-commit-msg/run-tests.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +tcdir="${top_srcdir-.}" +script="${top_srcdir-.}/git-check-commit-msg/git-check-commit-msg" + +errors=0 + +while read tc expect restofline +do + tcfile="${tcdir}/git-check-commit-msg/${tc}" + test -s "$tcfile" || continue + + "$script" "$tcfile"; s="$?" + + if [ "$s" -eq 0 ] && [ "x$expect" = "xOK" ]; then :; + elif [ "$s" -ne 0 ] && [ "x$expect" = "xFAIL" ]; then :; + else + sh -x "$script" "$tcfile" + echo "TC: $tc expected $expect, but deviates." + errors="$(expr $errors + 1)" + fi +done<