From: Eric S. Raymond Date: Mon, 10 Nov 2014 00:37:14 +0000 (-0500) Subject: Add a regression-test suite. X-Git-Tag: 1.0~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=b2ef3fb6383eb147f97550223a8f38a640eff70e;p=rcs-fast-import.git Add a regression-test suite. --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50b5565 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test/RCS diff --git a/Makefile b/Makefile index 5eefe10..ce49452 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,10 @@ rcs-fast-import.1: rcs-fast-import.xml rcs-fast-import.html: rcs-fast-import.xml xmlto html-nochunks rcs-fast-import.xml +# The regression test +check: + @cd test >/dev/null; $(MAKE) --quiet + clean: rm -f *~ *.1 *.html *.tar.gz MANIFEST rm -fr .rs* typescript test/typescript diff --git a/NEWS b/NEWS index ebc5f40..732eb07 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Repository head: + There is a regressuion test: run "make check". + Files imported can be resrricted with command-line arguments. + 0.3 @ 2014-06-05 Documentation polishing and stricter code validation with new pylint. diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..fd491d2 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,22 @@ +# Regression test for rcs-fast-import + +RCS-FAST-EXPORT = ../rcs-fast-import + +default: + @(cd ..; make -e --quiet pylint) + @make -e --quiet test + +test: + rm -fr RCS + $(RCS-FAST-EXPORT) +Author-Date: Mon 08 Nov 2010 18:03:59 -0500 +Committer: Eric S. Raymond +Committer-Date: Mon 08 Nov 2010 18:03:59 -0500 +Mark: :34 +Parents: :32 + +Give the deletion push a target. +@ +text +@This is a dummy test repository. + +It has no other purpose in life than to be used for making fast-import +files with which to test reposurgeon and, possibly, other similar tools. + +Once again, we need a commit to push some deletes forward to. +@ + + +1.5 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 20:49:31 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 20:49:31 -0400 +Mark: :28 +Parents: :26 + +This is a target commit for testing case M+R with ancestry of M. +@ +text +@d6 1 +a6 1 +We need a commit to push some deletes forward to. +@ + + +1.4 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 18:11:55 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 18:11:55 -0400 +Mark: :19 +Parents: :18 + +Commit this so we test a non-tip deletion reduction. +@ +text +@d5 2 +@ + + +1.3 +log +@Author: Eric S. Raymond +Author-Date: Fri 05 Nov 2010 18:54:01 -0400 +Committer: Eric S. Raymond +Committer-Date: Fri 05 Nov 2010 18:54:01 -0400 +Mark: :7 +Parents: :4 + +Creation of the first doomed file. +@ +text +@a4 3 + +Now we're going to modify this at the same time we create another file +whose destiny is to be deleted. +@ + + +1.2 +log +@Author: Eric S. Raymond +Author-Date: Fri 05 Nov 2010 18:47:47 -0400 +Committer: Eric S. Raymond +Committer-Date: Fri 05 Nov 2010 18:47:47 -0400 +Mark: :4 +Parents: :2 + +Conveniently, the first commit needded a typo fix. +@ +text +@d5 3 +@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Fri 05 Nov 2010 18:42:06 -0400 +Committer: Eric S. Raymond +Committer-Date: Fri 05 Nov 2010 18:42:06 -0400 +Mark: :2 + +Entirely boring first commit. +@ +text +@d4 1 +a4 1 +files with which to test reposurgeon and, possibly, other similsr tools. +@ diff --git a/test/testrepo-RCS/bar,v b/test/testrepo-RCS/bar,v new file mode 100644 index 0000000..c08598b --- /dev/null +++ b/test/testrepo-RCS/bar,v @@ -0,0 +1,80 @@ +head 1.3; +access; +symbols; +locks; strict; +comment @# @; + + +1.3 +date 2010.11.08.23.02.38; author esr; state Exp; +branches; +next 1.2; + +1.2 +date 2010.11.07.13.29.31; author esr; state Deleted; +branches; +next 1.1; + +1.1 +date 2010.11.07.00.47.47; author esr; state Exp; +branches; +next ; + + +desc +@@ + + +1.3 +log +@Author: Eric S. Raymond +Author-Date: Mon 08 Nov 2010 18:02:38 -0500 +Committer: Eric S. Raymond +Committer-Date: Mon 08 Nov 2010 18:02:38 -0500 +Mark: :32 +Parents: :30 + +Recreating bar. +@ +text +@Recreating bar after it was deleted, to test another canonicalization case. +@ + + +1.2 +log +@Author: Eric S. Raymond +Author-Date: Sun 07 Nov 2010 08:29:31 -0500 +Committer: Eric S. Raymond +Committer-Date: Sun 07 Nov 2010 08:29:31 -0500 +Mark: :29 +Parents: :28 + +Let's see what a mv of bar to renamed1 generates. + +Looks like it turns into a D bar M renamed1 rather than an R. +(git mv bar renamed1 throws an error.) +@ +text +@d1 1 +@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 20:47:47 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 20:47:47 -0400 +Mark: :26 +Parents: :25 + +Now foo gets renamed to bar. +@ +text +@a0 4 +Let's give it a third content modification. + + + +@ diff --git a/test/testrepo-RCS/copy1,v b/test/testrepo-RCS/copy1,v new file mode 100644 index 0000000..eda97ac --- /dev/null +++ b/test/testrepo-RCS/copy1,v @@ -0,0 +1,34 @@ +head 1.1; +access; +symbols; +locks; strict; +comment @# @; + + +1.1 +date 2010.11.08.22.56.44; author esr; state Exp; +branches; +next ; + + +desc +@@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Mon 08 Nov 2010 17:56:44 -0500 +Committer: Eric S. Raymond +Committer-Date: Mon 08 Nov 2010 17:56:44 -0500 +Mark: :30 +Parents: :29 + +This is an attempt to create a copy operation in the export file. +@ +text +@Let's give it a third content modification. + + + +@ diff --git a/test/testrepo-RCS/doomed1,v b/test/testrepo-RCS/doomed1,v new file mode 100644 index 0000000..9a099d0 --- /dev/null +++ b/test/testrepo-RCS/doomed1,v @@ -0,0 +1,52 @@ +head 1.2; +access; +symbols; +locks; strict; +comment @# @; + + +1.2 +date 2010.11.05.22.56.15; author esr; state Deleted; +branches; +next 1.1; + +1.1 +date 2010.11.05.22.54.01; author esr; state Exp; +branches; +next ; + + +desc +@@ + + +1.2 +log +@Author: Eric S. Raymond +Author-Date: Fri 05 Nov 2010 18:56:15 -0400 +Committer: Eric S. Raymond +Committer-Date: Fri 05 Nov 2010 18:56:15 -0400 +Mark: :8 +Parents: :7 + +Deleting the doomed1. Will produce M followed by D, case 1. +@ +text +@@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Fri 05 Nov 2010 18:54:01 -0400 +Committer: Eric S. Raymond +Committer-Date: Fri 05 Nov 2010 18:54:01 -0400 +Mark: :7 +Parents: :4 + +Creation of the first doomed file. +@ +text +@a0 1 +This file is doomed. Its destiny is to be deleted. +@ diff --git a/test/testrepo-RCS/doomed2,v b/test/testrepo-RCS/doomed2,v new file mode 100644 index 0000000..6ccbf25 --- /dev/null +++ b/test/testrepo-RCS/doomed2,v @@ -0,0 +1,53 @@ +head 1.2; +access; +symbols; +locks; strict; +comment @# @; + + +1.2 +date 2010.11.06.10.46.51; author esr; state Deleted; +branches; +next 1.1; + +1.1 +date 2010.11.06.10.13.09; author esr; state Exp; +branches; +next ; + + +desc +@@ + + +1.2 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 06:46:51 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 06:46:51 -0400 +Mark: :11 +Parents: :10 + +Rename doomed2 created in previous commit. Should produce M+R, case 2. +@ +text +@@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 06:13:09 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 06:13:09 -0400 +Mark: :10 +Parents: :8 + +Make the previous commit non-tip. +@ +text +@a0 2 +This file is doomed too. Though, right now, we're only using it to make +the previous commit non-tip. +@ diff --git a/test/testrepo-RCS/doomed3,v b/test/testrepo-RCS/doomed3,v new file mode 100644 index 0000000..912c93c --- /dev/null +++ b/test/testrepo-RCS/doomed3,v @@ -0,0 +1,100 @@ +head 1.4; +access; +symbols; +locks; strict; +comment @# @; + + +1.4 +date 2010.11.06.22.10.39; author esr; state Deleted; +branches; +next 1.3; + +1.3 +date 2010.11.06.22.10.08; author esr; state Exp; +branches; +next 1.2; + +1.2 +date 2010.11.06.22.09.30; author esr; state Exp; +branches; +next 1.1; + +1.1 +date 2010.11.06.10.49.58; author esr; state Exp; +branches; +next ; + + +desc +@@ + + +1.4 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 18:10:39 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 18:10:39 -0400 +Mark: :18 +Parents: :17 + +doomed3, thy end has arrived. +@ +text +@@ + + +1.3 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 18:10:08 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 18:10:08 -0400 +Mark: :17 +Parents: :15 + +Third commit to doomed3, so there will be an ancestry chain. +@ +text +@a0 3 +And let's give it another one for good measure. + + +@ + + +1.2 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 18:09:30 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 18:09:30 -0400 +Mark: :15 +Parents: :13 + +Second commit to doomed3, so there will be an ancestry chain. +@ +text +@d1 2 +a2 1 +This file needs to have at least one commit other than its creation. +@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 06:49:58 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 06:49:58 -0400 +Mark: :13 +Parents: :11 + +Create the third doomed file. +@ +text +@d1 2 +a2 1 +Creation of the third doomed file. +@ diff --git a/test/testrepo-RCS/foo,v b/test/testrepo-RCS/foo,v new file mode 100644 index 0000000..6783db1 --- /dev/null +++ b/test/testrepo-RCS/foo,v @@ -0,0 +1,101 @@ +head 1.4; +access; +symbols; +locks; strict; +comment @# @; + + +1.4 +date 2010.11.07.00.47.47; author esr; state Deleted; +branches; +next 1.3; + +1.3 +date 2010.11.07.00.47.02; author esr; state Exp; +branches; +next 1.2; + +1.2 +date 2010.11.07.00.46.42; author esr; state Exp; +branches; +next 1.1; + +1.1 +date 2010.11.06.22.51.51; author esr; state Exp; +branches; +next ; + + +desc +@@ + + +1.4 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 20:47:47 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 20:47:47 -0400 +Mark: :26 +Parents: :25 + +Now foo gets renamed to bar. +@ +text +@@ + + +1.3 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 20:47:02 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 20:47:02 -0400 +Mark: :25 +Parents: :23 + +Third content modification of foo. +@ +text +@a0 4 +Let's give it a third content modification. + + + +@ + + +1.2 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 20:46:42 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 20:46:42 -0400 +Mark: :23 +Parents: :21 + +Second content modification of foo. +@ +text +@d1 1 +a1 1 +Let's give it a second content modification. +@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 18:51:51 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 18:51:51 -0400 +Mark: :21 +Parents: :19 + +Build an ancestry for foo before we rename it. +@ +text +@d1 2 +a2 1 +The file foo needs a content modification so we can test a rename case. +@ diff --git a/test/testrepo-RCS/renamed1,v b/test/testrepo-RCS/renamed1,v new file mode 100644 index 0000000..3fde460 --- /dev/null +++ b/test/testrepo-RCS/renamed1,v @@ -0,0 +1,61 @@ +head 1.2; +access; +symbols; +locks; strict; +comment @# @; + + +1.2 +date 2010.11.07.13.29.31; author esr; state Exp; +branches; +next 1.1; + +1.1 +date 2010.11.06.10.46.51; author esr; state Exp; +branches; +next ; + + +desc +@@ + + +1.2 +log +@Author: Eric S. Raymond +Author-Date: Sun 07 Nov 2010 08:29:31 -0500 +Committer: Eric S. Raymond +Committer-Date: Sun 07 Nov 2010 08:29:31 -0500 +Mark: :29 +Parents: :28 + +Let's see what a mv of bar to renamed1 generates. + +Looks like it turns into a D bar M renamed1 rather than an R. +(git mv bar renamed1 throws an error.) +@ +text +@Let's give it a third content modification. + + + +@ + + +1.1 +log +@Author: Eric S. Raymond +Author-Date: Sat 06 Nov 2010 06:46:51 -0400 +Committer: Eric S. Raymond +Committer-Date: Sat 06 Nov 2010 06:46:51 -0400 +Mark: :11 +Parents: :10 + +Rename doomed2 created in previous commit. Should produce M+R, case 2. +@ +text +@d1 4 +a4 2 +This file is doomed too. Though, right now, we're only using it to make +the previous commit non-tip. +@ diff --git a/test/testrepo.fi b/test/testrepo.fi new file mode 100644 index 0000000..bfb0aa2 --- /dev/null +++ b/test/testrepo.fi @@ -0,0 +1,292 @@ +blob +mark :1 +data 180 +This is a dummy test repository. + +It has no other purpose in life than to be used for making fast-import +files with which to test reposurgeon and, possibly, other similsr tools. + +reset refs/heads/master +commit refs/heads/master +mark :2 +author Eric S. Raymond 1288996926 -0400 +committer Eric S. Raymond 1288996926 -0400 +data 30 +Entirely boring first commit. +M 100644 :1 README + +blob +mark :3 +data 180 +This is a dummy test repository. + +It has no other purpose in life than to be used for making fast-import +files with which to test reposurgeon and, possibly, other similar tools. + +commit refs/heads/master +mark :4 +author Eric S. Raymond 1288997267 -0400 +committer Eric S. Raymond 1288997267 -0400 +data 51 +Conveniently, the first commit needded a typo fix. +from :2 +M 100644 :3 README + +blob +mark :5 +data 284 +This is a dummy test repository. + +It has no other purpose in life than to be used for making fast-import +files with which to test reposurgeon and, possibly, other similar tools. + +Now we're going to modify this at the same time we create another file +whose destiny is to be deleted. + +blob +mark :6 +data 51 +This file is doomed. Its destiny is to be deleted. + +commit refs/heads/master +mark :7 +author Eric S. Raymond 1288997641 -0400 +committer Eric S. Raymond 1288997641 -0400 +data 35 +Creation of the first doomed file. +from :4 +M 100644 :5 README +M 100644 :6 doomed1 + +commit refs/heads/master +mark :8 +author Eric S. Raymond 1288997775 -0400 +committer Eric S. Raymond 1288997775 -0400 +data 61 +Deleting the doomed1. Will produce M followed by D, case 1. +from :7 +D doomed1 + +blob +mark :9 +data 102 +This file is doomed too. Though, right now, we're only using it to make +the previous commit non-tip. + +commit refs/heads/master +mark :10 +author Eric S. Raymond 1289038389 -0400 +committer Eric S. Raymond 1289038389 -0400 +data 34 +Make the previous commit non-tip. +from :8 +M 100644 :9 doomed2 + +commit refs/heads/master +mark :11 +author Eric S. Raymond 1289040411 -0400 +committer Eric S. Raymond 1289040411 -0400 +data 72 +Rename doomed2 created in previous commit. Should produce M+R, case 2. +from :10 +R "doomed2" "renamed1" + +blob +mark :12 +data 35 +Creation of the third doomed file. + +commit refs/heads/master +mark :13 +author Eric S. Raymond 1289040598 -0400 +committer Eric S. Raymond 1289040598 -0400 +data 30 +Create the third doomed file. +from :11 +M 100644 :12 doomed3 + +blob +mark :14 +data 70 +This file needs to have at least one commit other than its creation. + + +commit refs/heads/master +mark :15 +author Eric S. Raymond 1289081370 -0400 +committer Eric S. Raymond 1289081370 -0400 +data 62 +Second commit to doomed3, so there will be an ancestry chain. +from :13 +M 100644 :14 doomed3 + +blob +mark :16 +data 50 +And let's give it another one for good measure. + + + +commit refs/heads/master +mark :17 +author Eric S. Raymond 1289081408 -0400 +committer Eric S. Raymond 1289081408 -0400 +data 61 +Third commit to doomed3, so there will be an ancestry chain. +from :15 +M 100644 :16 doomed3 + +commit refs/heads/master +mark :18 +author Eric S. Raymond 1289081439 -0400 +committer Eric S. Raymond 1289081439 -0400 +data 30 +doomed3, thy end has arrived. +from :17 +D doomed3 + +commit refs/heads/master +mark :19 +author Eric S. Raymond 1289081515 -0400 +committer Eric S. Raymond 1289081515 -0400 +data 53 +Commit this so we test a non-tip deletion reduction. +from :18 +M 100644 :3 README + +blob +mark :20 +data 74 +The file foo needs a content modification so we can test a rename case. + + + +commit refs/heads/master +mark :21 +author Eric S. Raymond 1289083911 -0400 +committer Eric S. Raymond 1289083911 -0400 +data 47 +Build an ancestry for foo before we rename it. +from :19 +M 100644 :20 foo + +blob +mark :22 +data 48 +Let's give it a second content modification. + + + + +commit refs/heads/master +mark :23 +author Eric S. Raymond 1289090802 -0400 +committer Eric S. Raymond 1289090802 -0400 +data 36 +Second content modification of foo. +from :21 +M 100644 :22 foo + +blob +mark :24 +data 47 +Let's give it a third content modification. + + + + +commit refs/heads/master +mark :25 +author Eric S. Raymond 1289090822 -0400 +committer Eric S. Raymond 1289090822 -0400 +data 35 +Third content modification of foo. +from :23 +M 100644 :24 foo + +commit refs/heads/master +mark :26 +author Eric S. Raymond 1289090867 -0400 +committer Eric S. Raymond 1289090867 -0400 +data 29 +Now foo gets renamed to bar. +from :25 +R "foo" "bar" + +blob +mark :27 +data 231 +This is a dummy test repository. + +It has no other purpose in life than to be used for making fast-import +files with which to test reposurgeon and, possibly, other similar tools. + +We need a commit to push some deletes forward to. + +commit refs/heads/master +mark :28 +author Eric S. Raymond 1289090971 -0400 +committer Eric S. Raymond 1289090971 -0400 +data 65 +This is a target commit for testing case M+R with ancestry of M. +from :26 +M 100644 :27 README + +commit refs/heads/master +mark :29 +author Eric S. Raymond 1289136571 -0500 +committer Eric S. Raymond 1289136571 -0500 +data 152 +Let's see what a mv of bar to renamed1 generates. + +Looks like it turns into a D bar M renamed1 rather than an R. +(git mv bar renamed1 throws an error.) +from :28 +D bar +M 100644 :24 renamed1 + +commit refs/heads/master +mark :30 +author Eric S. Raymond 1289257004 -0500 +committer Eric S. Raymond 1289257004 -0500 +data 66 +This is an attempt to create a copy operation in the export file. +from :29 +M 100644 :24 copy1 + +blob +mark :31 +data 76 +Recreating bar after it was deleted, to test another canonicalization case. + +commit refs/heads/master +mark :32 +author Eric S. Raymond 1289257358 -0500 +committer Eric S. Raymond 1289257358 -0500 +data 16 +Recreating bar. +from :30 +M 100644 :31 bar + +blob +mark :33 +data 243 +This is a dummy test repository. + +It has no other purpose in life than to be used for making fast-import +files with which to test reposurgeon and, possibly, other similar tools. + +Once again, we need a commit to push some deletes forward to. + +commit refs/heads/master +mark :34 +author Eric S. Raymond 1289257439 -0500 +committer Eric S. Raymond 1289257439 -0500 +data 33 +Give the deletion push a target. +from :32 +M 100644 :33 README + +reset refs/heads/master +from :34 +