Code

cvs tests: do not touch test CVS repositories shipped with source
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Aug 2010 16:25:01 +0000 (09:25 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Aug 2010 19:43:24 +0000 (12:43 -0700)
Some tests in t96xx series (cvsimport) want to write into the control area
(CVSROOT) of their test CVS repositories, but this does not work well when
the source area is made read-only (test trash directories are moved via
--root=else/where option).

Copy the supplied test CVS repository to a scratch place at the beginning
of these tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/Makefile
t/lib-cvs.sh
t/t9601-cvsimport-vendor-branch.sh
t/t9602-cvsimport-branches-tags.sh
t/t9603-cvsimport-patchsets.sh

index d9c67f5609bad30d8f5bde2bdf3e7d3fb217894d..c7baefb7eac27fff31e3e78c7862eb2bf73d9068 100644 (file)
@@ -29,7 +29,6 @@ pre-clean:
 
 clean:
        $(RM) -r 'trash directory'.* test-results
-       $(RM) t????/cvsroot/CVSROOT/?*
        $(RM) -r valgrind/bin
        $(RM) .prove
 
index 648d1619c86bb676faadf62bd831683cb46d6be2..b51d2e13a60352c652db35e812b6949dea4d0f56 100644 (file)
@@ -30,6 +30,12 @@ case "$cvsps_version" in
        ;;
 esac
 
+setup_cvs_test_repository () {
+       CVSROOT="$(pwd)/.cvsroot" &&
+       cp -r "$TEST_DIRECTORY/$1/cvsroot" "$CVSROOT" &&
+       export CVSROOT
+}
+
 test_cvs_co () {
        # Usage: test_cvs_co BRANCH_NAME
        rm -rf module-cvs-"$1"
index 71178e2e5fa91920dd9662688b061e3c28a81141..827d39f5bf28652cc3d9fdf2f331592ed0b46ecc 100755 (executable)
 test_description='git cvsimport handling of vendor branches'
 . ./lib-cvs.sh
 
-test_expect_success PERL 'setup CVSROOT' '
-       CVSROOT="$TEST_DIRECTORY"/t9601/cvsroot &&
-       export CVSROOT
-'
+setup_cvs_test_repository t9601
 
 test_expect_success PERL 'import a module with a vendor branch' '
 
index 89da4aead5275ac30449f9a1702e1de7b5c29c40..e1db323f545fccfdadbf2bc1df1060e006674298 100755 (executable)
@@ -6,10 +6,7 @@
 test_description='git cvsimport handling of branches and tags'
 . ./lib-cvs.sh
 
-test_expect_success PERL 'setup CVSROOT' '
-       CVSROOT="$TEST_DIRECTORY"/t9602/cvsroot &&
-       export CVSROOT
-'
+setup_cvs_test_repository t9602
 
 test_expect_success PERL 'import module' '
 
index 958bdce4dd8891fa648ba2bf554b18cae91de712..93c4fa885eeff16c57a58d8dc4fa7537cde54ea9 100755 (executable)
@@ -14,8 +14,7 @@
 test_description='git cvsimport testing for correct patchset estimation'
 . ./lib-cvs.sh
 
-CVSROOT="$TEST_DIRECTORY"/t9603/cvsroot
-export CVSROOT
+setup_cvs_test_repository t9603
 
 test_expect_failure 'import with criss cross times on revisions' '