Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t9400: Use test_cmp when appropriate
author
Junio C Hamano
<gitster@pobox.com>
Fri, 12 Mar 2010 05:40:33 +0000
(21:40 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 12 Mar 2010 05:40:33 +0000
(21:40 -0800)
Consistently using test_cmp would make debugging test scripts far easier,
as output from them run under "-v" option becomes readable.
Besides, some platforms' "diff" implementations lack "-q" option.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9400-git-cvsserver-server.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
7ff8b79
)
diff --git
a/t/t9400-git-cvsserver-server.sh
b/t/t9400-git-cvsserver-server.sh
index 4327eb8baa2b00b0833fdbceac27bb8291370bda..daef2d6c230fb617395feeff6cf330b74ad57832 100755
(executable)
--- a/
t/t9400-git-cvsserver-server.sh
+++ b/
t/t9400-git-cvsserver-server.sh
@@
-226,7
+226,7
@@
test_expect_success 'gitcvs.ext.enabled = true' \
'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
-
diff -q
cvswork cvswork2'
+
test_cmp
cvswork cvswork2'
rm -fr cvswork2
test_expect_success 'gitcvs.ext.enabled = false' \
rm -fr cvswork2
test_expect_success 'gitcvs.ext.enabled = false' \
@@
-247,7
+247,7
@@
test_expect_success 'gitcvs.dbname' \
'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true &&
GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
-
diff -q
cvswork cvswork2 &&
+
test_cmp
cvswork cvswork2 &&
test -f "$SERVERDIR/gitcvs.ext.master.sqlite" &&
cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs.ext.master.sqlite"'
test -f "$SERVERDIR/gitcvs.ext.master.sqlite" &&
cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs.ext.master.sqlite"'
@@
-257,7
+257,7
@@
test_expect_success 'gitcvs.ext.dbname' \
GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 &&
-
diff -q
cvswork cvswork2 &&
+
test_cmp
cvswork cvswork2 &&
test -f "$SERVERDIR/gitcvs1.ext.master.sqlite" &&
test ! -f "$SERVERDIR/gitcvs2.ext.master.sqlite" &&
cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs1.ext.master.sqlite"'
test -f "$SERVERDIR/gitcvs1.ext.master.sqlite" &&
test ! -f "$SERVERDIR/gitcvs2.ext.master.sqlite" &&
cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs1.ext.master.sqlite"'
@@
-282,7
+282,7
@@
test_expect_success 'cvs update (create new file)' \
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
-
diff -q
testfile1 ../testfile1'
+
test_cmp
testfile1 ../testfile1'
cd "$WORKDIR"
test_expect_success 'cvs update (update existing file)' \
cd "$WORKDIR"
test_expect_success 'cvs update (update existing file)' \
@@
-293,7
+293,7
@@
test_expect_success 'cvs update (update existing file)' \
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
-
diff -q
testfile1 ../testfile1'
+
test_cmp
testfile1 ../testfile1'
cd "$WORKDIR"
#TODO: cvsserver doesn't support update w/o -d
cd "$WORKDIR"
#TODO: cvsserver doesn't support update w/o -d
@@
-322,7
+322,7
@@
test_expect_success 'cvs update (subdirectories)' \
(for dir in A A/B A/B/C A/D E; do
filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
(for dir in A A/B A/B/C A/D E; do
filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
-
diff -q
"$dir/$filename" "../$dir/$filename"; then
+
test_cmp
"$dir/$filename" "../$dir/$filename"; then
:
else
echo >failure
:
else
echo >failure
@@
-349,7
+349,7
@@
test_expect_success 'cvs update (re-add deleted file)' \
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
-
diff -q
testfile1 ../testfile1'
+
test_cmp
testfile1 ../testfile1'
cd "$WORKDIR"
test_expect_success 'cvs update (merge)' \
cd "$WORKDIR"
test_expect_success 'cvs update (merge)' \
@@
-366,7
+366,7
@@
test_expect_success 'cvs update (merge)' \
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
test "$(echo $(grep merge CVS/Entries|cut -d/ -f2,3,5))" = "merge/1.1/" &&
-
diff -q
merge ../merge &&
+
test_cmp
merge ../merge &&
( echo Line 0; cat merge ) >merge.tmp &&
mv merge.tmp merge &&
cd "$WORKDIR" &&
( echo Line 0; cat merge ) >merge.tmp &&
mv merge.tmp merge &&
cd "$WORKDIR" &&
@@
-377,7
+377,7
@@
test_expect_success 'cvs update (merge)' \
cd cvswork &&
sleep 1 && touch merge &&
GIT_CONFIG="$git_config" cvs -Q update &&
cd cvswork &&
sleep 1 && touch merge &&
GIT_CONFIG="$git_config" cvs -Q update &&
-
diff -q
merge ../expected'
+
test_cmp
merge ../expected'
cd "$WORKDIR"
cd "$WORKDIR"
@@
-402,13
+402,13
@@
test_expect_success 'cvs update (conflict merge)' \
git push gitcvs.git >/dev/null &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
-
diff -q
merge ../expected.C'
+
test_cmp
merge ../expected.C'
cd "$WORKDIR"
test_expect_success 'cvs update (-C)' \
'cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update -C &&
cd "$WORKDIR"
test_expect_success 'cvs update (-C)' \
'cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update -C &&
-
diff -q
merge ../merge'
+
test_cmp
merge ../merge'
cd "$WORKDIR"
test_expect_success 'cvs update (merge no-op)' \
cd "$WORKDIR"
test_expect_success 'cvs update (merge no-op)' \
@@
-420,7
+420,7
@@
test_expect_success 'cvs update (merge no-op)' \
cd cvswork &&
sleep 1 && touch merge &&
GIT_CONFIG="$git_config" cvs -Q update &&
cd cvswork &&
sleep 1 && touch merge &&
GIT_CONFIG="$git_config" cvs -Q update &&
-
diff -q
merge ../merge'
+
test_cmp
merge ../merge'
cd "$WORKDIR"
test_expect_success 'cvs update (-p)' '
cd "$WORKDIR"
test_expect_success 'cvs update (-p)' '