From eea420693befc2f876079a8a4585ea8ebf07c047 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 10 Dec 2005 20:55:32 -0800 Subject: [PATCH] t0000: catch trivial pilot errors. People seem to be getting test failure from t6021 not becuase git is faulty but because they forgot to install "merge". Check this and other trivial pilot errors in the first test. Signed-off-by: Junio C Hamano --- t/t0000-basic.sh | 29 +++++++++++++++++++++++++++++ t/test-lib.sh | 9 +++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 22bdacaf78..bc3e711a52 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -17,8 +17,37 @@ IDs. When object ID computation changes, like in the previous case of 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 are getting bitten by not installing +# 'merge' (usually part of RCS package in binary distributions) +# or have too old python without subprocess. Check them and error +# out before running any tests. Also catch the bogosity of trying +# to run tests without building while we are at it. + +../git >/dev/null +if test $? != 1 +then + echo >&2 'You do not seem to have built git yet.' + exit 1 +fi + +merge >/dev/null 2>/dev/null +if test $? == 127 +then + echo >&2 'You do not seem to have "merge" installed. +Please check INSTALL document.' + exit 1 +fi + . ./test-lib.sh +"$PYTHON" -c 'import subprocess' || { + echo >&2 'Your python seem to lack "subprocess" module. +Please check INSTALL document.' + exit 1 +} + ################################################################ # init-db has been done in an empty repository. # make sure it is empty. diff --git a/t/test-lib.sh b/t/test-lib.sh index 447d9e2517..2819bef1c4 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -179,11 +179,16 @@ export PATH GIT_EXEC_PATH PYTHON=`sed -e '1{ s/^#!// q -}' ../git-merge-recursive` && +}' ../git-merge-recursive` || { + error "You haven't built things yet, have you?" +} "$PYTHON" -c 'import subprocess' 2>/dev/null || { PYTHONPATH=$(pwd)/../compat export PYTHONPATH } +test -d ../templates/blt || { + error "You haven't built things yet, have you?" +} # Test repository test=trash @@ -191,6 +196,6 @@ rm -fr "$test" mkdir "$test" cd "$test" "$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null || -error "cannot run git init-db" +error "cannot run git init-db -- have you built things yet?" mv .git/hooks .git/hooks-disabled