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>
Junio C Hamano committed
Dec 10, 2005 at 20:55 UTC
eea420693befc2f876079a8a4585ea8ebf07c047
2 files changed
+36
-2
t/t0000-basic.sh
+29
@@ -17,8 +17,37 @@ IDs. When object ID computation changes, like in the previous case of
17
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 are getting bitten by not installing
23
+# 'merge' (usually part of RCS package in binary distributions)
24
+# or have too old python without subprocess. Check them and error
25
+# out before running any tests. Also catch the bogosity of trying
26
+# to run tests without building while we are at it.
27
+
28
+../git >/dev/null
29
+if test $? != 1
30
+then
31
+ echo >&2 'You do not seem to have built git yet.'
32
+ exit 1
33
+fi
34
+
35
+merge >/dev/null 2>/dev/null
36
+if test $? == 127
37
+then
38
+ echo >&2 'You do not seem to have "merge" installed.
39
+Please check INSTALL document.'
40
+ exit 1
41
+fi
42
+
43
. ./test-lib.sh
44
45
+"$PYTHON" -c 'import subprocess' || {
46
+ echo >&2 'Your python seem to lack "subprocess" module.
47
+Please check INSTALL document.'
48
+ exit 1
49
+}
50
+
51
################################################################
52
# init-db has been done in an empty repository.
53
# make sure it is empty.
t/test-lib.sh
+7
-2
@@ -179,11 +179,16 @@ export PATH GIT_EXEC_PATH
179
PYTHON=`sed -e '1{
180
s/^#!//
181
q
182
-}' ../git-merge-recursive` &&
182
+}' ../git-merge-recursive` || {
183
+ error "You haven't built things yet, have you?"
184
+}
185
"$PYTHON" -c 'import subprocess' 2>/dev/null || {
186
PYTHONPATH=$(pwd)/../compat
187
export PYTHONPATH
188
}
189
+test -d ../templates/blt || {
190
+ error "You haven't built things yet, have you?"
191
+}
192
193
# Test repository
194
test=trash
@@ -191,6 +196,6 @@ rm -fr "$test"
196
mkdir "$test"
197
cd "$test"
198
"$GIT_EXEC_PATH/git" init-db --template=../../templates/blt/ 2>/dev/null ||
194
-error "cannot run git init-db"
199
+error "cannot run git init-db -- have you built things yet?"
200
201
mv .git/hooks .git/hooks-disabled