summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-03 23:46:02 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-03 23:46:02 -0800
commit423325a2d24638ddcc82ce47be5e40be550f4507 (patch)
tree00960b001d786299d3da04a4467bd0c798bf8cda /t/test-lib.sh
parent93dcab2937624ebb97f91807576cddb242a55a46 (diff)
parentd79374c7b58d3814ffdc277de608243f8e665e3a (diff)
GIT 0.99.9l aka 1.0rc4v1.0rc4v0.99.9l
Diffstat (limited to 't/test-lib.sh')
-rwxr-xr-xt/test-lib.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index e654155a2e..f2eccd7918 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -133,6 +133,19 @@ test_expect_success () {
fi
}
+test_expect_code () {
+ test "$#" = 3 ||
+ error "bug in the test script: not 3 parameters to test-expect-code"
+ say >&3 "expecting exit code $1: $3"
+ test_run_ "$3"
+ if [ "$?" = 0 -a "$eval_ret" = "$1" ]
+ then
+ test_ok_ "$2"
+ else
+ test_failure_ "$@"
+ fi
+}
+
test_done () {
trap - exit
case "$test_failure" in