Skip to content

Commit 2006f0a

Browse files
artagnongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5805853 commit 2006f0a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

t/t0000-basic.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ swapping compression and hashing order, the person who is making the
1818
modification *should* take notice and update the test vectors here.
1919
'
2020

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-
3121
. ./test-lib.sh
3222

3323
################################################################

t/test-lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ then
5151
fi
5252
GIT_BUILD_DIR="$TEST_DIRECTORY"/..
5353

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+
5463
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
5564
export PERL_PATH SHELL_PATH
5665

0 commit comments

Comments
 (0)