fsck: default to "git fsck --full"
[gitweb.git] / t / t9600-cvsimport.sh
index 29fee2dd13c6826338e92bf6e61cc39b057da444..363345faef7b1eb209c548914b94460d9475cb13 100755 (executable)
@@ -1,27 +1,22 @@
 #!/bin/sh
 
-test_description='git-cvsimport basic tests'
-. ./test-lib.sh
+test_description='git cvsimport basic tests'
+. ./lib-cvs.sh
 
-if ! ( type cvs && type cvsps ) >/dev/null 2>&1
-then
-       test_expect_success 'skipping cvsimport tests, cvs/cvsps not found' ''
+if ! test_have_prereq PERL; then
+       say 'skipping git cvsimport tests, perl not available'
        test_done
-       exit
 fi
 
 CVSROOT=$(pwd)/cvsroot
 export CVSROOT
-# for clean cvsps cache
-HOME=$(pwd)
-export HOME
 
-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 &&
+       mkdir "$CVSROOT/module" &&
+       $CVS co -d module-cvs module &&
        cd module-cvs &&
        cat <<EOF >o_fortuna &&
 O Fortuna
@@ -40,20 +35,20 @@ egestatem,
 potestatem
 dissolvit ut glaciem.
 EOF
-       cvs add o_fortuna &&
+       $CVS add o_fortuna &&
        cat <<EOF >message &&
 add "O Fortuna" lyrics
 
 These public domain lyrics make an excellent sample text.
 EOF
-       cvs commit -F message &&
+       $CVS commit -F message &&
        cd ..
 '
 
 test_expect_success 'import a trivial module' '
 
        git cvsimport -a -z 0 -C module-git module &&
-       git diff module-cvs/o_fortuna module-git/o_fortuna
+       test_cmp module-cvs/o_fortuna module-git/o_fortuna
 
 '
 
@@ -84,7 +79,7 @@ translate to English
 
 My Latin is terrible.
 EOF
-       cvs commit -F message &&
+       $CVS commit -F message &&
        cd ..
 '
 
@@ -94,7 +89,7 @@ test_expect_success 'update git module' '
        git cvsimport -a -z 0 module &&
        git merge origin &&
        cd .. &&
-       git diff module-cvs/o_fortuna module-git/o_fortuna
+       test_cmp module-cvs/o_fortuna module-git/o_fortuna
 
 '
 
@@ -102,8 +97,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 ..
 
 '
@@ -115,8 +110,22 @@ test_expect_success 'cvsimport.module config works' '
                git cvsimport -a -z0 &&
                git merge origin &&
        cd .. &&
-       git diff module-cvs/tick module-git/tick
+       test_cmp module-cvs/tick module-git/tick
 
 '
 
+test_expect_success 'import from a CVS working tree' '
+
+       $CVS co -d import-from-wt module &&
+       cd import-from-wt &&
+               git cvsimport -a -z0 &&
+               echo 1 >expect &&
+               git log -1 --pretty=format:%s%n >actual &&
+               test_cmp actual expect &&
+       cd ..
+
+'
+
+test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master'
+
 test_done