git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: David Michael Barr <david.barr@cordelta.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	avarb@gmail.com, Daniel Shahaf <d.s@daniel.shahaf.name>,
	Bert Huijben <rhuijben@collab.net>,
	Junio C Hamano <gitster@pobox.com>,
	Eric Wong <normalperson@yhbt.net>,
	dev@subversion.apache.org
Subject: [PATCH 13/13] Add a validation script
Date: Wed,  7 Jul 2010 02:14:53 +0200	[thread overview]
Message-ID: <1278461693-3828-14-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1278461693-3828-1-git-send-email-artagnon@gmail.com>

Add a validation script along with a .gitignore. Using an existing
dump known to be correct (possibly generated using `svnsync` and
`svnadmin dump --deltas`), it compares the outputs produced by
`svnadmin load` when fed with this dump and the dump from the program.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 .gitignore  |    4 ++++
 validate.sh |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
 create mode 100755 validate.sh

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3e9b906
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*~
+t/
+svndumpr
+svndumpr_bench
diff --git a/validate.sh b/validate.sh
new file mode 100755
index 0000000..7b25db6
--- /dev/null
+++ b/validate.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+# asf.dump must exist in t/
+# Compile the program with end_revision = $2 when using the second branch
+
+case $1 in
+    generate)
+	[ -z $2 ] && { echo "Usage: $0 $1 <revision>"; exit 1; } || echo "Starting generation ...";
+	if test -e "t/asf.dump"
+	    then :;
+	else
+	    echo "Need t/asf.dump (dumpfile v3) first. Generate it yourself or steal it from someone.";
+	    exit 1;
+	fi
+	rm -rf t/repo;
+	mkdir t/repo;
+	svnadmin create t/repo;
+	gawk "/Revision-number: $(($2 + 1))/ { exit 1 }; { print \$0 };" t/asf.dump > "t/asf-$2.dump";
+	[ $? = 1 ] && echo "Cut $2 succeeded!" || { echo "Cut $2 failed. Check t/asf.dump and validate.sh."; exit 1; }
+	svnadmin load t/repo < "t/asf-$2.dump" 1>"t/asf-$2-import.log" 2>"t/asf-$2-import.error";
+	[ $? = 0 ] && echo "Load $2 succeeded!" || { echo "Load $2 failed. See t/asf-$2-import.debug for details."; exit 1; }
+	echo "Successfully generated asf-$2.dump and asf-$2-import.log. You can now run validate.sh validate $2"
+	exit 0;;
+    validate)
+	[ -z $2 ] && { echo "Usage: $0 $1 <revision>"; exit 1; } || echo "Starting validation ...";
+	if test -e "t/asf-$2.dump" && test -e "t/asf-$2-import.log"
+	    then :;
+	else
+	    echo "Run validate.sh genereate $2 first.";
+	    exit 1;
+	fi
+	rm -rf /tmp/svn-fe;
+	mkdir /tmp/svn-fe;
+	rm -rf t/repo;
+	mkdir t/repo;
+	svnadmin create t/repo;
+	make svndumpr > /dev/null;
+	[ $? = 0 ] && echo "Make succeeded!" || { echo "Make failed. Check the program."; exit 1; }
+	./svndumpr 1>t/asf-mine.dump;
+	[ $? = 0 ] && echo "Run succeeded!" || { echo "Run failed. See t/asf.debug for details."; exit 1; }
+	diff -au "t/asf-$2.dump" t/asf-mine.dump > t/dump-diff.error;
+	gawk '$0 !~ "Prop-delta: true|Text-delta-base-|sha1|Text-copy-source-|^-$" && $0 ~ "^+|^-" { print; }' t/dump-diff.error > t/dump-diff-filtered.error;
+	svnadmin load t/repo < t/asf-mine.dump 1>t/asf-mine-import.log 2>t/asf-mine-import.error;
+	[ $? = 0 ] && echo "Load $2 succeeded!" || { echo "Load failed. See t/asf-mine-import.error, t/dump-diff.error, and t/dump-diff-filtered.error for details."; exit 1; }
+	diff -au "t/asf-$2-import.log" t/asf-mine-import.log > t/import-diff.error;
+	[ $? = 0 ] && echo "Validation $2 succeeded!" || { echo "Validation failed. See t/import-diff.error for details."; exit 1; }
+	exit 0;;
+    *)
+	echo "Usage: $0 <operation> <revision>";
+	exit 1;;
+esac
-- 
1.7.1

  parent reply	other threads:[~2010-07-07  0:14 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07  0:14 [GSoC update] git-remote-svn: Week 10 Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 01/13] Add LICENSE Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 02/13] Add skeleton SVN client and Makefile Ramkumar Ramachandra
2010-07-07 16:25   ` Jonathan Nieder
2010-07-07 17:09     ` Ramkumar Ramachandra
2010-07-07 19:30       ` Jonathan Nieder
2010-07-07 20:47         ` Ramkumar Ramachandra
2010-07-07 17:51     ` Daniel Shahaf
2010-07-07  0:14 ` [PATCH 03/13] Add debug editor from Subversion trunk Ramkumar Ramachandra
2010-07-07 17:55   ` Jonathan Nieder
2010-07-07  0:14 ` [PATCH 04/13] Add skeleton dump editor Ramkumar Ramachandra
2010-07-07 18:16   ` Jonathan Nieder
2010-07-08  6:17     ` Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 05/13] Drive the debug editor Ramkumar Ramachandra
2010-07-07 18:26   ` Jonathan Nieder
2010-07-07 19:08     ` Ramkumar Ramachandra
2010-07-07 19:53       ` Jonathan Nieder
2010-07-08  6:04         ` Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 06/13] Dump the revprops at the start of every revision Ramkumar Ramachandra
2010-07-07 19:04   ` Jonathan Nieder
2010-07-21 18:55     ` Ramkumar Ramachandra
2010-07-26 14:03       ` Julian Foad
2010-07-26 17:53         ` Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 07/13] Implement open_root and close_edit Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 08/13] Implement dump_node Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 09/13] Implement directory-related functions Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 10/13] Implement file-related functions Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 11/13] Implement apply_textdelta Ramkumar Ramachandra
2010-07-07  0:14 ` [PATCH 12/13] Implement close_file Ramkumar Ramachandra
2010-07-07  0:14 ` Ramkumar Ramachandra [this message]
2010-07-07 20:24 ` [GSoC update] git-remote-svn: Week 10 Ramkumar Ramachandra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1278461693-3828-14-git-send-email-artagnon@gmail.com \
    --to=artagnon@gmail.com \
    --cc=avarb@gmail.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=david.barr@cordelta.com \
    --cc=dev@subversion.apache.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=normalperson@yhbt.net \
    --cc=rhuijben@collab.net \
    --cc=srabbelier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).