Commits

Anonymous committed eea4206

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 <junkio@cox.net>

Comments (0)

Files changed (2)

 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.
 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
 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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.