Skip to content

Commit

Permalink
cvs tests: do not touch test CVS repositories shipped with source
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Aug 18, 2010
1 parent 06eaaa7 commit 9b777a1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion t/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pre-clean:

clean:
$(RM) -r 'trash directory'.* test-results
$(RM) t????/cvsroot/CVSROOT/?*
$(RM) -r valgrind/bin
$(RM) .prove

Expand Down
6 changes: 6 additions & 0 deletions t/lib-cvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 1 addition & 4 deletions t/t9601-cvsimport-vendor-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
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' '
Expand Down
5 changes: 1 addition & 4 deletions t/t9602-cvsimport-branches-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' '
Expand Down
3 changes: 1 addition & 2 deletions t/t9603-cvsimport-patchsets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' '
Expand Down

0 comments on commit 9b777a1

Please sign in to comment.