git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/5] Test contents of entire cvsimported "master" tree contents

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Feb 21, 2009, 13:04 UTC
Message-ID
<cda1b6751447f990ca0e45e2e54f62ae9c53e6c1.1235220105.git.mhagger@alum.mit.edu>
In-Reply-To
<7d834a5a7542df6bfa8963bb6440cc4b4531ead7.1235220105.git.mhagger@alum.mit.edu>
Test added for completeness (it passes).
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 t/lib-cvs.sh         |   41 +++++++++++++++++++++++++++++++++++++++++
 t/t9600-cvsimport.sh |    2 ++
 2 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 6738901..47f0e55 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -32,3 +32,44 @@ case "$cvsps_version" in
 	exit
 	;;
 esac
+
+test_cvs_export () {
+	# Usage: test_cvs_export 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
+	# Remove the CVS directories to make directory comparisons
+	# easier:
+	find module-cvs-"$1" -type d -name CVS -exec rm -rf '{}' ';' -prune
+}
+
+test_git_co_branch () {
+	# Usage: test_git_co BRANCH_NAME
+	(cd module-git && git checkout "$1")
+}
+
+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_export "$1" &&
+	test_git_co_branch "$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
+}
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 3110a8c..e3734b3 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -121,4 +121,6 @@ test_expect_success 'import from a CVS working tree' '
 
 '
 
+test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master'
+
 test_done
-- 
1.6.1.3
Previous: Michael HaggertyNext: Michael Haggerty
Message 4 of 14 in “Add more tests of cvsimport”
  1. 0/4 Add more tests of cvsimportMichael Haggerty, Feb 21, 2009
  2. 1/5 Start a library for cvsimport-related testsMichael Haggerty, Feb 21, 2009
  3. 2/5 Use CVS's -f option if available (ignore user's ~/.cvsrc file)Michael Haggerty, Feb 21, 2009
  4. 3/5 Test contents of entire cvsimported "master" tree contentsMichael Haggerty, Feb 21, 2009
  5. 4/5 Add some tests of git-cvsimport's handling of vendor branchesMichael Haggerty, Feb 21, 2009
  6. 5/5 Add a test of "git cvsimport"'s handling of tags and branchesMichael Haggerty, Feb 21, 2009
  7. Junio C HamanoFeb 22, 2009
  8. 0/5 Add more tests of cvsimportMichael Haggerty, Feb 23, 2009
  9. 1/5 Start a library for cvsimport-related testsMichael Haggerty, Feb 23, 2009
  10. 2/5 Use CVS's -f option if available (ignore user's ~/.cvsrc file)Michael Haggerty, Feb 23, 2009
  11. 3/5 Test contents of entire cvsimported "master" tree contentsMichael Haggerty, Feb 23, 2009
  12. 4/5 Add some tests of git-cvsimport's handling of vendor branchesMichael Haggerty, Feb 23, 2009
  13. 5/5 Add a test of "git cvsimport"'s handling of tags and branchesMichael Haggerty, Feb 23, 2009
  14. Junio C HamanoFeb 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.