Code

Merge git://git.kernel.org/pub/scm/gitk/gitk
[git.git] / t / t9600-cvsimport.sh
index 00a74ee7384e4b824c9faf9e6d7891e4f28c775a..4322a0c1ed6d792cbba4b52a7ba8bad74986bbad 100755 (executable)
@@ -1,10 +1,16 @@
 #!/bin/sh
 
-test_description='git-cvsimport basic tests'
+test_description='git cvsimport basic tests'
 . ./test-lib.sh
 
+if ! test_have_prereq PERL; then
+       say 'skipping git cvsimport tests, perl not available'
+       test_done
+fi
+
 CVSROOT=$(pwd)/cvsroot
 export CVSROOT
+unset CVS_SERVER
 # for clean cvsps cache
 HOME=$(pwd)
 export HOME
@@ -13,22 +19,19 @@ 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.1 | 2.2*)
        ;;
 '')
        say 'skipping cvsimport tests, cvsps not found'
        test_done
-       exit
        ;;
 *)
-       say 'skipping cvsimport tests, cvsps too old'
+       say 'skipping cvsimport tests, unsupported cvsps version'
        test_done
-       exit
        ;;
 esac
 
@@ -36,7 +39,7 @@ test_expect_success 'setup cvsroot' 'cvs init'
 
 test_expect_success 'setup a cvs module' '
 
-       mkdir $CVSROOT/module &&
+       mkdir "$CVSROOT/module" &&
        cvs co -d module-cvs module &&
        cd module-cvs &&
        cat <<EOF >o_fortuna &&
@@ -69,7 +72,7 @@ EOF
 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
 
 '
 
@@ -110,7 +113,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
 
 '
 
@@ -131,7 +134,7 @@ 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
 
 '
 
@@ -142,7 +145,7 @@ test_expect_success 'import from a CVS working tree' '
                git cvsimport -a -z0 &&
                echo 1 >expect &&
                git log -1 --pretty=format:%s%n >actual &&
-               git diff actual expect &&
+               test_cmp actual expect &&
        cd ..
 
 '