summaryrefslogtreecommitdiff
path: root/t/lib-cvs.sh
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2009-02-23 05:08:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-24 05:56:46 (GMT)
commitcefa318ddbc8565b50ac2eb9b6aab93e26cc0abe (patch)
tree861ef1b672c36e8e4f8b1af8c9c4d23fe9ac6706 /t/lib-cvs.sh
parent161261b12b3777bc78ef3fbe84ccf595dd195704 (diff)
downloadgit-cefa318ddbc8565b50ac2eb9b6aab93e26cc0abe.zip
git-cefa318ddbc8565b50ac2eb9b6aab93e26cc0abe.tar.gz
git-cefa318ddbc8565b50ac2eb9b6aab93e26cc0abe.tar.bz2
Test contents of entire cvsimported "master" tree contents
Test added for completeness (it passes). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-cvs.sh')
-rw-r--r--t/lib-cvs.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 6738901..1f73c07 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -32,3 +32,47 @@ case "$cvsps_version" in
exit
;;
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
+}