summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 41ff7a1)
raw | patch | inline | side by side (parent: 41ff7a1)
author | Carl Worth <cworth@cworth.org> | |
Fri, 17 Feb 2006 21:33:26 +0000 (13:33 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 18 Feb 2006 00:16:53 +0000 (16:16 -0800) |
Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
t/test-lib.sh | patch | blob | history |
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7a58a86f967fdb114bb980a631292da2cee2a352..66f62b9c6f2a31965c856fc9b7d056a86abbcfbc 100755 (executable)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
fi
}
+# Most tests can use the created repository, but some amy need to create more.
+# Usage: test_create_repo <directory>
+test_create_repo () {
+ test "$#" = 1 ||
+ error "bug in the test script: not 1 parameter to test-create-repo"
+ owd=`pwd`
+ repo="$1"
+ mkdir "$repo"
+ cd "$repo" || error "Cannot setup test environment"
+ "$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ 2>/dev/null ||
+ error "cannot run git init-db -- have you built things yet?"
+ mv .git/hooks .git/hooks-disabled
+ cd "$owd"
+}
+
test_done () {
trap - exit
case "$test_failure" in
# Test repository
test=trash
rm -fr "$test"
-mkdir "$test"
-cd "$test" || error "Cannot setup test environment"
-"$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null ||
-error "cannot run git init-db -- have you built things yet?"
-
-mv .git/hooks .git/hooks-disabled
+test_create_repo $test
+cd "$test"