From 535bb89320ba949f0d64eda530ba5dec0ec6f188 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 23 Feb 2009 06:08:10 +0100 Subject: Start a library for cvsimport-related tests For now the library just includes code (moved from t/t9600-cvsimport.sh) that checks whether the prerequisites for "git cvsimport" are installed. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- t/t9600-cvsimport.sh | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 't/t9600-cvsimport.sh') diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index d2379e7f62..98077ab12b 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -1,37 +1,10 @@ #!/bin/sh test_description='git cvsimport basic tests' -. ./test-lib.sh +. ./lib-cvs.sh CVSROOT=$(pwd)/cvsroot export CVSROOT -unset CVS_SERVER -# for clean cvsps cache -HOME=$(pwd) -export HOME - -if ! type cvs >/dev/null 2>&1 -then - say 'skipping cvsimport tests, cvs not found' - test_done - exit -fi - -cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'` -case "$cvsps_version" in -2.1 | 2.2*) - ;; -'') - say 'skipping cvsimport tests, cvsps not found' - test_done - exit - ;; -*) - say 'skipping cvsimport tests, unsupported cvsps version' - test_done - exit - ;; -esac test_expect_success 'setup cvsroot' 'cvs init' -- cgit v1.2.1 From 161261b12b3777bc78ef3fbe84ccf595dd195704 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 23 Feb 2009 06:08:11 +0100 Subject: Use CVS's -f option if available (ignore user's ~/.cvsrc file) A user's ~/.cvsrc file can change the basic behavior of CVS commands. Therefore we should ignore it in order to ensure consistent results from the test suite. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- t/t9600-cvsimport.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 't/t9600-cvsimport.sh') diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index 98077ab12b..3110a8ce36 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -6,12 +6,12 @@ test_description='git cvsimport basic tests' CVSROOT=$(pwd)/cvsroot export CVSROOT -test_expect_success 'setup cvsroot' 'cvs init' +test_expect_success 'setup cvsroot' '$CVS init' test_expect_success 'setup a cvs module' ' mkdir "$CVSROOT/module" && - cvs co -d module-cvs module && + $CVS co -d module-cvs module && cd module-cvs && cat <o_fortuna && O Fortuna @@ -30,13 +30,13 @@ egestatem, potestatem dissolvit ut glaciem. EOF - cvs add o_fortuna && + $CVS add o_fortuna && cat <message && add "O Fortuna" lyrics These public domain lyrics make an excellent sample text. EOF - cvs commit -F message && + $CVS commit -F message && cd .. ' @@ -74,7 +74,7 @@ translate to English My Latin is terrible. EOF - cvs commit -F message && + $CVS commit -F message && cd .. ' @@ -92,8 +92,8 @@ test_expect_success 'update cvs module' ' cd module-cvs && echo 1 >tick && - cvs add tick && - cvs commit -m 1 + $CVS add tick && + $CVS commit -m 1 cd .. ' @@ -111,7 +111,7 @@ test_expect_success 'cvsimport.module config works' ' test_expect_success 'import from a CVS working tree' ' - cvs co -d import-from-wt module && + $CVS co -d import-from-wt module && cd import-from-wt && git cvsimport -a -z0 && echo 1 >expect && -- cgit v1.2.1 From cefa318ddbc8565b50ac2eb9b6aab93e26cc0abe Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 23 Feb 2009 06:08:12 +0100 Subject: Test contents of entire cvsimported "master" tree contents Test added for completeness (it passes). Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- t/t9600-cvsimport.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 't/t9600-cvsimport.sh') diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index 3110a8ce36..e3734b3ba9 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -121,4 +121,6 @@ test_expect_success 'import from a CVS working tree' ' ' +test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master' + test_done -- cgit v1.2.1