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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty 2009-02-23 06:08:10 +01:00 committed by Junio C Hamano
parent 8c5b85ce87
commit 535bb89320
2 changed files with 32 additions and 28 deletions

31
t/lib-cvs.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/sh
. ./test-lib.sh
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

View File

@ -1,37 +1,10 @@
#!/bin/sh #!/bin/sh
test_description='git cvsimport basic tests' test_description='git cvsimport basic tests'
. ./test-lib.sh . ./lib-cvs.sh
CVSROOT=$(pwd)/cvsroot CVSROOT=$(pwd)/cvsroot
export 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' test_expect_success 'setup cvsroot' 'cvs init'