t/test-lib: make sure Git has already been built

When tests were run without building git, they stopped with: .: 54: Can't open /path/to/git/source/t/../GIT-BUILD-OPTIONS Move the check that makes sure that git has already been built from t0000 to test-lib, so that any test will do so before it runs. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramkumar Ramachandra committed Sep 17, 2012 at 22:36 UTC 2006f0adaee036145b4261b942d944adb18647ed
2 files changed +9 -10
t/t0000-basic.sh
-10
@@ -18,16 +18,6 @@ swapping compression and hashing order, the person who is making the
18 modification *should* take notice and update the test vectors here.
19 '
20
21 -################################################################
22 -# It appears that people try to run tests without building...
23 -
24 -../git >/dev/null
25 -if test $? != 1
26 -then
27 - echo >&2 'You do not seem to have built git yet.'
28 - exit 1
29 -fi
30 -
21 . ./test-lib.sh
22
23 ################################################################
t/test-lib.sh
+9
@@ -51,6 +51,15 @@ then
51 fi
52 GIT_BUILD_DIR="$TEST_DIRECTORY"/..
53
54 +################################################################
55 +# It appears that people try to run tests without building...
56 +"$GIT_BUILD_DIR/git" >/dev/null
57 +if test $? != 1
58 +then
59 + echo >&2 'error: you do not seem to have built git yet.'
60 + exit 1
61 +fi
62 +
63 . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
64 export PERL_PATH SHELL_PATH
65