@matheusbsbs / matheus-bagliano / commits / 535bb89320
Fork 0

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>

Michael Haggerty committed Feb 23, 2009 at 06:08 UTC 535bb89320ba949f0d64eda530ba5dec0ec6f188
2 files changed +32 -28
t/lib-cvs.sh new
+31
@@ -0,0 +1,31 @@
1 +#!/bin/sh
2 +
3 +. ./test-lib.sh
4 +
5 +unset CVS_SERVER
6 +# for clean cvsps cache
7 +HOME=$(pwd)
8 +export HOME
9 +
10 +if ! type cvs >/dev/null 2>&1
11 +then
12 + say 'skipping cvsimport tests, cvs not found'
13 + test_done
14 + exit
15 +fi
16 +
17 +cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
18 +case "$cvsps_version" in
19 +2.1 | 2.2*)
20 + ;;
21 +'')
22 + say 'skipping cvsimport tests, cvsps not found'
23 + test_done
24 + exit
25 + ;;
26 +*)
27 + say 'skipping cvsimport tests, unsupported cvsps version'
28 + test_done
29 + exit
30 + ;;
31 +esac
t/t9600-cvsimport.sh
+1 -28
@@ -1,37 +1,10 @@
1 #!/bin/sh
2
3 test_description='git cvsimport basic tests'
4 -. ./test-lib.sh
4 +. ./lib-cvs.sh
5
6 CVSROOT=$(pwd)/cvsroot
7 export CVSROOT
8 -unset CVS_SERVER
9 -# for clean cvsps cache
10 -HOME=$(pwd)
11 -export HOME
12 -
13 -if ! type cvs >/dev/null 2>&1
14 -then
15 - say 'skipping cvsimport tests, cvs not found'
16 - test_done
17 - exit
18 -fi
19 -
20 -cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
21 -case "$cvsps_version" in
22 -2.1 | 2.2*)
23 - ;;
24 -'')
25 - say 'skipping cvsimport tests, cvsps not found'
26 - test_done
27 - exit
28 - ;;
29 -*)
30 - say 'skipping cvsimport tests, unsupported cvsps version'
31 - test_done
32 - exit
33 - ;;
34 -esac
8
9 test_expect_success 'setup cvsroot' 'cvs init'
10