Merge branch 'rr/test-make-sure-we-have-git'
authorJunio C Hamano <gitster@pobox.com>
Tue, 25 Sep 2012 17:40:24 +0000 (10:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Sep 2012 17:40:24 +0000 (10:40 -0700)
Only the first test t0000 in the test suite made sure we have built
Git to be tested; move the check to test-lib so that it applies to
all tests equally.

* rr/test-make-sure-we-have-git:
  t/test-lib: make sure Git has already been built

t/t0000-basic.sh
t/test-lib.sh

index ae6a3f077742c0504b8ed8f56b98289c704ce8f9..08677df10e9d2a4c87fbe1e5d24eb836b1117e64 100755 (executable)
@@ -18,16 +18,6 @@ swapping compression and hashing order, the person who is making the
 modification *should* take notice and update the test vectors here.
 '
 
-################################################################
-# It appears that people try to run tests without building...
-
-../git >/dev/null
-if test $? != 1
-then
-       echo >&2 'You do not seem to have built git yet.'
-       exit 1
-fi
-
 . ./test-lib.sh
 
 ################################################################
index aad46066adf0021b721bb3a2e235e2b012f13422..bff3d7570c675c7b6fbc71342909b0a930aae1a0 100644 (file)
@@ -51,6 +51,15 @@ then
 fi
 GIT_BUILD_DIR="$TEST_DIRECTORY"/..
 
+################################################################
+# It appears that people try to run tests without building...
+"$GIT_BUILD_DIR/git" >/dev/null
+if test $? != 1
+then
+       echo >&2 'error: you do not seem to have built git yet.'
+       exit 1
+fi
+
 . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
 export PERL_PATH SHELL_PATH