From 535bb89320ba949f0d64eda530ba5dec0ec6f188 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 23 Feb 2009 06:08:10 +0100 Subject: [PATCH] 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/lib-cvs.sh | 31 +++++++++++++++++++++++++++++++ t/t9600-cvsimport.sh | 29 +---------------------------- 2 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 t/lib-cvs.sh diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh new file mode 100644 index 000000000..bfc1c12f3 --- /dev/null +++ b/t/lib-cvs.sh @@ -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 diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index d2379e7f6..98077ab12 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' -- 2.26.2