-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hv/cvsps-tests: t/t9600: remove exit after test_done cvsimport: extend testcase about patchset order to contain branches cvsimport: add test illustrating a bug in cvsps Add a test of "git cvsimport"'s handling of tags and branches Add some tests of git-cvsimport's handling of vendor branches Test contents of entire cvsimported "master" tree contents Use CVS's -f option if available (ignore user's ~/.cvsrc file) Start a library for cvsimport-related tests
- Loading branch information
Showing
28 changed files
with
1,627 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/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 | ||
fi | ||
|
||
CVS="cvs -f" | ||
export CVS | ||
|
||
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 | ||
;; | ||
*) | ||
say 'skipping cvsimport tests, unsupported cvsps version' | ||
test_done | ||
;; | ||
esac | ||
|
||
test_cvs_co () { | ||
# Usage: test_cvs_co BRANCH_NAME | ||
rm -rf module-cvs-"$1" | ||
if [ "$1" = "master" ] | ||
then | ||
$CVS co -P -d module-cvs-"$1" -A module | ||
else | ||
$CVS co -P -d module-cvs-"$1" -r "$1" module | ||
fi | ||
} | ||
|
||
test_git_co () { | ||
# Usage: test_git_co BRANCH_NAME | ||
(cd module-git && git checkout "$1") | ||
} | ||
|
||
test_cmp_branch_file () { | ||
# Usage: test_cmp_branch_file BRANCH_NAME PATH | ||
# The branch must already be checked out of CVS and git. | ||
test_cmp module-cvs-"$1"/"$2" module-git/"$2" | ||
} | ||
|
||
test_cmp_branch_tree () { | ||
# Usage: test_cmp_branch_tree BRANCH_NAME | ||
# Check BRANCH_NAME out of CVS and git and make sure that all | ||
# of the files and directories are identical. | ||
|
||
test_cvs_co "$1" && | ||
test_git_co "$1" && | ||
( | ||
cd module-cvs-"$1" | ||
find . -type d -name CVS -prune -o -type f -print | ||
) | sort >module-cvs-"$1".list && | ||
( | ||
cd module-git | ||
find . -type d -name .git -prune -o -type f -print | ||
) | sort >module-git-"$1".list && | ||
test_cmp module-cvs-"$1".list module-git-"$1".list && | ||
cat module-cvs-"$1".list | while read f | ||
do | ||
test_cmp_branch_file "$1" "$f" || return 1 | ||
done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/sh | ||
|
||
# Description of the files in the repository: | ||
# | ||
# imported-once.txt: | ||
# | ||
# Imported once. 1.1 and 1.1.1.1 should be identical. | ||
# | ||
# imported-twice.txt: | ||
# | ||
# Imported twice. HEAD should reflect the contents of the | ||
# second import (i.e., have the same contents as 1.1.1.2). | ||
# | ||
# imported-modified.txt: | ||
# | ||
# Imported, then modified on HEAD. HEAD should reflect the | ||
# modification. | ||
# | ||
# imported-modified-imported.txt: | ||
# | ||
# Imported, then modified on HEAD, then imported again. | ||
# | ||
# added-imported.txt,v: | ||
# | ||
# Added with 'cvs add' to create 1.1, then imported with | ||
# completely different contents to create 1.1.1.1, therefore the | ||
# vendor branch was never the default branch. | ||
# | ||
# imported-anonymously.txt: | ||
# | ||
# Like imported-twice.txt, but with a vendor branch whose branch | ||
# tag has been removed. | ||
|
||
test_description='git cvsimport handling of vendor branches' | ||
. ./lib-cvs.sh | ||
|
||
CVSROOT="$TEST_DIRECTORY"/t9601/cvsroot | ||
export CVSROOT | ||
|
||
test_expect_success 'import a module with a vendor branch' ' | ||
git cvsimport -C module-git module | ||
' | ||
|
||
test_expect_success 'check HEAD out of cvs repository' 'test_cvs_co master' | ||
|
||
test_expect_success 'check master out of git repository' 'test_git_co master' | ||
|
||
test_expect_success 'check a file that was imported once' ' | ||
test_cmp_branch_file master imported-once.txt | ||
' | ||
|
||
test_expect_failure 'check a file that was imported twice' ' | ||
test_cmp_branch_file master imported-twice.txt | ||
' | ||
|
||
test_expect_success 'check a file that was imported then modified on HEAD' ' | ||
test_cmp_branch_file master imported-modified.txt | ||
' | ||
|
||
test_expect_success 'check a file that was imported, modified, then imported again' ' | ||
test_cmp_branch_file master imported-modified-imported.txt | ||
' | ||
|
||
test_expect_success 'check a file that was added to HEAD then imported' ' | ||
test_cmp_branch_file master added-imported.txt | ||
' | ||
|
||
test_expect_success 'a vendor branch whose tag has been removed' ' | ||
test_cmp_branch_file master imported-anonymously.txt | ||
' | ||
|
||
test_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* -whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
history | ||
val-tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
head 1.1; | ||
access; | ||
symbols | ||
vtag-4:1.1.1.1 | ||
vbranchA:1.1.1; | ||
locks; strict; | ||
comment @# @; | ||
|
||
|
||
1.1 | ||
date 2004.02.09.15.43.15; author kfogel; state Exp; | ||
branches | ||
1.1.1.1; | ||
next ; | ||
|
||
1.1.1.1 | ||
date 2004.02.09.15.43.16; author kfogel; state Exp; | ||
branches; | ||
next ; | ||
|
||
|
||
desc | ||
@@ | ||
|
||
|
||
1.1 | ||
log | ||
@Add a file to the working copy. | ||
@ | ||
text | ||
@Adding this file, before importing it with different contents. | ||
@ | ||
|
||
|
||
1.1.1.1 | ||
log | ||
@Import (vbranchA, vtag-4). | ||
@ | ||
text | ||
@d1 1 | ||
a1 1 | ||
This is vtag-4 (on vbranchA) of added-then-imported.txt. | ||
@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
head 1.1; | ||
branch 1.1.1; | ||
access; | ||
symbols | ||
vtag-1:1.1.1.1; | ||
locks; strict; | ||
comment @# @; | ||
|
||
|
||
1.1 | ||
date 2004.02.09.15.43.13; author kfogel; state Exp; | ||
branches | ||
1.1.1.1; | ||
next ; | ||
|
||
1.1.1.1 | ||
date 2004.02.09.15.43.13; author kfogel; state Exp; | ||
branches; | ||
next ; | ||
|
||
|
||
desc | ||
@@ | ||
|
||
|
||
1.1 | ||
log | ||
@Initial revision | ||
@ | ||
text | ||
@This is vtag-1 (on vbranchA) of imported-anonymously.txt. | ||
@ | ||
|
||
|
||
1.1.1.1 | ||
log | ||
@Import (vbranchA, vtag-1). | ||
@ | ||
text | ||
@@ | ||
|
||
|
Oops, something went wrong.