quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH 1/2] Separate working directory for each test case


From: Jean Delvare
Subject: [Quilt-dev] [PATCH 1/2] Separate working directory for each test case
Date: Sun, 13 Dec 2009 18:14:07 +0100
User-agent: KMail/1.9.1

Let the test suite runner script create a separate working
directory for each test. This makes it possible to run several
tests in parallel, speeding up testing on SMP systems. It also
ensures that a broken test case can no longer cause another test
case to fail.

At this point, it is possible to run the test suite in parallel,
the final result (success or failure) will be correct, however
the output is hardly readable because the progress of all tests
are interlaced. This will be improved later.

As a nice side effect, this means we can drop the setup and
clean-up steps that were present in all test cases.

---
 test/add-filename-check.test |    8 +---
 test/annotate.test           |    7 ----
 test/applied.test            |    7 ----
 test/basedir.no-test         |    7 ----
 test/comments.test           |    8 +---
 test/conflicts.test          |   13 ++-----
 test/create-delete.test      |    7 ----
 test/delete.test             |    7 ----
 test/dir-a-b.test            |    7 ----
 test/dotglob.test            |    7 ----
 test/edit.test               |    7 ----
 test/empty.test              |    7 ----
 test/example1.test           |   40 ++++++++++--------------
 test/failpop.test            |    7 ----
 test/fold.test               |   27 ++++++----------
 test/formats.test            |    7 +---
 test/half-applies.test       |    6 ---
 test/header.test             |   15 +++------
 test/import.test             |    8 ----
 test/import2.test            |    7 ----
 test/mail.test               |    7 ----
 test/merge.test              |   15 +++------
 test/missing.test            |    7 ----
 test/new-nosubdir.test       |    7 ----
 test/new.test                |   19 ++++-------
 test/nolink.test             |    7 ----
 test/null-bug.test           |    7 ----
 test/one.test                |   50 +++++++++++++-----------------
 test/patch-wrapper.test      |    7 ----
 test/perms.test              |    8 +---
 test/refresh-z.test          |    7 ----
 test/rename.test             |    7 ----
 test/revert.test             |    7 ----
 test/revert2.test            |    7 ----
 test/run                     |   21 ++++++++++++
 test/setup.test              |    7 +---
 test/snapshot.test           |   13 ++-----
 test/snapshot2.test          |   14 +++-----
 test/sort.test               |   71 +++++++++++++++++++------------------------
 test/space-in-filenames.test |    8 +---
 test/subdir.test             |   23 +++++--------
 test/three.test              |   18 +++-------
 test/trailing-ws.test        |    7 ----
 test/two.test                |   50 +++++++++++++-----------------
 44 files changed, 210 insertions(+), 393 deletions(-)

--- a/test/run
+++ b/test/run
@@ -61,9 +61,22 @@ my $prog_line = 0;
 my ($tests, $failed) = (0,0);
 my $lineno;
 my $width = ($ENV{COLUMNS} || 80) >> 1;
+my $origdir = getcwd;
+my $workdir = "d.$$";
+
+# Create a dedicated working directory
+mkdir $workdir or die;
+chdir $workdir or die;
+$ENV{PWD} = getcwd;
+
+if (defined $ARGV[0]) {
+       open(SOURCE, "$origdir/$ARGV[0]");
+} else {
+       *SOURCE = *STDIN;
+}
 
 for (;;) {
-  my $line = <>; $lineno++;
+  my $line = <SOURCE>; $lineno++;
   if (defined $line) {
     # Substitute %VAR and %{VAR} with environment variables.
     $line =~ s[%(\w+)][$ENV{$1}]eg;
@@ -93,6 +106,12 @@ for (;;) {
   }
 }
 
+close(SOURCE);
+
+# Clean up the mess
+chdir $origdir or die;
+system "rm -rf $workdir";
+
 my $status = sprintf("%d commands (%d passed, %d failed)",
        $tests, $tests-$failed, $failed);
 if (isatty(fileno(STDOUT))) {
--- a/test/add-filename-check.test
+++ b/test/add-filename-check.test
@@ -1,6 +1,5 @@
-$ rm -rf d
-$ mkdir -p d/patches
-$ cd d
+$ mkdir patches
+
 $ quilt new test.diff
 >Patch patches/test.diff is now on top
 
@@ -13,6 +12,3 @@ $ quilt add patches/bar
 
 $ quilt add .pc/baz
 > File .pc/baz is located below .pc/
-
-$ cd ..
-$ rm -rf d
--- a/test/annotate.test
+++ b/test/annotate.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
        
        $ cat > foo
        < foo
@@ -114,6 +112,3 @@
        > 1     two
        >
        > 1     patches/patch4
-
-       $ cd ..
-       $ rm -rf d
--- a/test/applied.test
+++ b/test/applied.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
        
        $ echo a > a
        $ echo b > b
@@ -35,6 +33,3 @@
        > Applying patch patches/patch
        > 1 out of 1 hunk FAILED
        > Patch patches/patch can be reverse-applied
-
-       $ cd ..
-       $ rm -rf d
--- a/test/basedir.no-test
+++ b/test/basedir.no-test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ echo foo.orig > foo.orig
        $ echo foo > foo
@@ -24,6 +22,3 @@
        > Applying patch patches/foo.diff
        > Applying patch patches/bar.diff
        > Now at patch patches/bar.diff
-
-       $ cd ..
-       $ rm -rf d
--- a/test/comments.test
+++ b/test/comments.test
@@ -1,9 +1,8 @@
 Regresion test case: Empty lines in patch descriptions were
 accidentally removed.
 
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
+
        $ echo one > f
        $ cat > patches/test.diff
        < C1
@@ -75,6 +74,3 @@ accidentally removed.
        > @@ -1 +1 @@
        > -one
        > +two
-       $ cd ..
-       $ rm -rf d
-
--- a/test/conflicts.test
+++ b/test/conflicts.test
@@ -2,9 +2,7 @@ This test case creates a patch and then 
 source file. The source file is modified until the patch doesn't apply
 anymore, then the patch is fixed.
 
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > one.txt
        < 1
@@ -73,7 +71,7 @@ anymore, then the patch is fixed.
        $ sed -e "s/4/4+/" one.x > one.txt
        $ rm -f one.x
        $ quilt diff -z | grep -v "^\\(---\\|+++\\)"
-       > Index: d/one.txt
+       >~ Index: [^/]+/one\.txt
        > ===================================================================
        > @@ -1,7 +1,7 @@
        >  1-
@@ -86,7 +84,7 @@ anymore, then the patch is fixed.
        >  7-
 
        $ quilt diff | grep -v "^\\(---\\|+++\\)"
-       > Index: d/one.txt
+       >~ Index: [^/]+/one\.txt
        > ===================================================================
        > @@ -1,7 +1,7 @@
        >  1-
@@ -111,7 +109,7 @@ anymore, then the patch is fixed.
        > Refreshed patch %{P}a.diff
 
        $ cat patches/a.diff | grep -v "^\\(---\\|+++\\)"
-       > Index: d/one.txt
+       >~ Index: [^/]+/one\.txt
        > ===================================================================
        > @@ -1,7 +1,7 @@
        >  1-
@@ -135,6 +133,3 @@ anymore, then the patch is fixed.
        $ quilt pop -q
        > Removing patch %{P}a.diff
        > No patches applied
-
-       $ cd ..
-       $ rm -rf d
--- a/test/create-delete.test
+++ b/test/create-delete.test
@@ -1,9 +1,7 @@
 Check whether quilt generates patches properly so that GNU patch recognizes
 file creates and deletions.
 
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ echo delete > delete
        $ quilt new test.diff
@@ -40,6 +38,3 @@ file creates and deletions.
        > Apply anyway? [n] 
        > Skipping patch.
        > 1 out of 1 hunk ignored
-
-       $ cd ..
-       $ rm -rf d
--- a/test/delete.test
+++ b/test/delete.test
@@ -1,8 +1,6 @@
 Test the delete command.
 
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt delete
        > No patches in series
@@ -99,6 +97,3 @@ Test the delete command.
 
        $ quilt delete test3
        > Removed patch %{P}test3
-
-       $ cd ..
-       $ rm -rf d
--- a/test/dir-a-b.test
+++ b/test/dir-a-b.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ echo a > test.txt
        $ echo d > test3.txt
@@ -63,6 +61,3 @@
        $ quilt pop -qR
        > Removing patch patches/ab.diff
        > No patches applied
-
-       $ cd ..
-       $ rm -rf d
--- a/test/dotglob.test
+++ b/test/dotglob.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt new dotglob.diff
        > Patch patches/dotglob.diff is now on top
@@ -19,6 +17,3 @@
        $ quilt push -q
        > Applying patch patches/dotglob.diff
        > Now at patch patches/dotglob.diff
-       
-       $ cd ..
-       $ rm -rf d
--- a/test/edit.test
+++ b/test/edit.test
@@ -1,6 +1,4 @@
-$ rm -rf d
-$ mkdir -p d/patches d/subdir
-$ cd d
+$ mkdir patches subdir
 
 $ cat > editor
 < #! /bin/sh
@@ -34,6 +32,3 @@ $ cat subdir/foo
 $ quilt files
 > foobar
 > subdir/foo
-
-$ cd ../..
-$ rm -rf d
--- a/test/empty.test
+++ b/test/empty.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > patches/series
        < empty1.diff
@@ -34,6 +32,3 @@
 
        $ quilt rename -P empty3.diff empty_new.diff
        > Patch %{P}empty3.diff renamed to %{P}empty_new.diff
-
-       $ cd ..
-       $ rm -rf d
--- a/test/example1.test
+++ b/test/example1.test
@@ -1,9 +1,8 @@
 The text used here was taken from:
 http://the-tech.mit.edu/Shakespeare/midsummer/full.html
 
-       $ rm -rf example1
-       $ mkdir -p example1/patches
-       $ cd example1
+       $ mkdir patches
+
        $ cat > Oberon.txt
        < Yet mark'd I where the bolt of Cupid fell:
        < It fell upon a little western flower,
@@ -23,14 +22,14 @@ http://the-tech.mit.edu/Shakespeare/mids
 
 Or ``quilt edit Oberon.txt''
 
-       $ quilt refresh
+       $ quilt refresh -p ab
        > Refreshed patch %{P}flower.diff
 
        $ cat patches/flower.diff
-       > Index: example1/Oberon.txt
+       > Index: b/Oberon.txt
        > ===================================================================
-       > --- example1.orig/Oberon.txt
-       > +++ example1/Oberon.txt
+       > --- a/Oberon.txt
+       > +++ b/Oberon.txt
        > @@ -2,3 +2,6 @@
        >  It fell upon a little western flower,
        >  Before milk-white, now purple with love's wound,
@@ -43,11 +42,11 @@ Or ``quilt edit Oberon.txt''
        $ echo "Fetch me that flower; the herb I shew'd thee once:" >> 
Oberon.new
        $ sed -e '1,4d' Oberon.txt >> Oberon.new
        $ mv Oberon.new Oberon.txt
-       $ quilt diff -z
-       > Index: example1/Oberon.txt
+       $ quilt diff -z -p ab
+       > Index: b/Oberon.txt
        > ===================================================================
-       > --- example1.orig/Oberon.txt
-       > +++ example1/Oberon.txt
+       > --- a/Oberon.txt
+       > +++ b/Oberon.txt
        > @@ -2,6 +2,7 @@
        >  It fell upon a little western flower,
        >  Before milk-white, now purple with love's wound,
@@ -57,11 +56,11 @@ Or ``quilt edit Oberon.txt''
        >  Will make a man or woman madly dote
        >  Upon the next live creature that it sees.
 
-       $ quilt diff
-       > Index: example1/Oberon.txt
+       $ quilt diff -p ab
+       > Index: b/Oberon.txt
        > ===================================================================
-       > --- example1.orig/Oberon.txt
-       > +++ example1/Oberon.txt
+       > --- a/Oberon.txt
+       > +++ b/Oberon.txt
        > @@ -2,3 +2,7 @@
        >  It fell upon a little western flower,
        >  Before milk-white, now purple with love's wound,
@@ -110,7 +109,7 @@ Or ``quilt edit Oberon.txt''
        < Will make a man or woman madly dote
        < Upon the next live creature that it sees.
        
-       $ quilt refresh
+       $ quilt refresh -p ab
        > Refreshed patch %{P}flower.diff
 
        $ cat Oberon.txt
@@ -124,10 +123,10 @@ Or ``quilt edit Oberon.txt''
        > Upon the next live creature that it sees.
 
        $ cat patches/flower.diff
-       > Index: example1/Oberon.txt
+       > Index: b/Oberon.txt
        > ===================================================================
-       > --- example1.orig/Oberon.txt
-       > +++ example1/Oberon.txt
+       > --- a/Oberon.txt
+       > +++ b/Oberon.txt
        > @@ -2,3 +2,7 @@
        >  It fell upon a little western flower,
        >  Before milk-white, now purple with love's wound,
@@ -136,6 +135,3 @@ Or ``quilt edit Oberon.txt''
        > +The juice of it on sleeping eye-lids laid
        > +Will make a man or woman madly dote
        > +Upon the next live creature that it sees.
-
-       $ cd ..
-       $ rm -rf example1
--- a/test/failpop.test
+++ b/test/failpop.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > test.txt
        < This is test.txt.
@@ -23,6 +21,3 @@
        $ mv patches/test.new patches/test.diff
        $ quilt pop
        > Patch %{P}test.diff does not remove cleanly (refresh it or enforce 
with -f)
-
-       $ cd ..
-       $ rm -rf d
--- a/test/fold.test
+++ b/test/fold.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > patches/series
        < patch1.diff
@@ -33,17 +31,17 @@
        < @@ -0,0 +1 @@
        < +This is file3.txt.
 
-       $ quilt diff
-       > Index: d/file1.txt
+       $ quilt diff -p ab
+       > Index: b/file1.txt
        > ===================================================================
        > --- /dev/null
-       > +++ d/file1.txt
+       > +++ b/file1.txt
        > @@ -0,0 +1 @@
        > +This is file1.txt.
-       > Index: d/dir/file3.txt
+       > Index: b/dir/file3.txt
        > ===================================================================
        > --- /dev/null
-       > +++ d/dir/file3.txt
+       > +++ b/dir/file3.txt
        > @@ -0,0 +1 @@
        > +This is file3.txt.
 
@@ -56,19 +54,16 @@
        < +This is file3.txt, now modified.
 
        $ cd ..
-       $ quilt diff
-       > Index: d/file1.txt
+       $ quilt diff -p ab
+       > Index: b/file1.txt
        > ===================================================================
        > --- /dev/null
-       > +++ d/file1.txt
+       > +++ b/file1.txt
        > @@ -0,0 +1 @@
        > +This is file1.txt.
-       > Index: d/dir/file3.txt
+       > Index: b/dir/file3.txt
        > ===================================================================
        > --- /dev/null
-       > +++ d/dir/file3.txt
+       > +++ b/dir/file3.txt
        > @@ -0,0 +1 @@
        > +This is file3.txt, now modified.
-
-       $ cd ..
-       $ rm -rf d
--- a/test/formats.test
+++ b/test/formats.test
@@ -1,4 +1,6 @@
-       $ rm -rf d
+       # We create our own working directory to be able to verify
+       # all patch formats, including the ones which mention the
+       # base directory.
        $ mkdir -p d/patches
        $ cd d
 
@@ -116,6 +118,3 @@
        > +new
        >  4
        >  5
-
-       $ cd ..
-       $ rm -rf d
--- a/test/half-applies.test
+++ b/test/half-applies.test
@@ -1,6 +1,4 @@
-$ rm -rf d
-$ mkdir -p d/patches
-$ cd d
+$ mkdir patches
 
 $ echo foo > foo.orig
 $ echo foo2 > foo
@@ -40,5 +38,3 @@ $ quilt diff
 > @@ -1 +1 @@
 > -foo
 > +foo2
-$ cd ..
-$ rm -rf d
--- a/test/header.test
+++ b/test/header.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ echo foo > foo
        $ quilt new patch
@@ -10,7 +8,7 @@
        > File foo added to patch patches/patch
        
        $ echo bar > foo
-       $ quilt refresh
+       $ quilt refresh -p ab
        > Refreshed patch patches/patch
 
        $ mv patches/patch patches/patch~
@@ -37,13 +35,10 @@
        $ cat patches/patch
        > Header2
        > Appended
-       > Index: d/foo
+       > Index: b/foo
        > ===================================================================
-       > --- d.orig/foo
-       > +++ d/foo
+       > --- a/foo
+       > +++ b/foo
        > @@ -1 +1 @@
        > -foo
        > +bar
-
-       $ cd ..
-       $ rm -rf d
--- a/test/import.test
+++ b/test/import.test
@@ -1,7 +1,4 @@
-
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt new patch1.diff
        > Patch %{P}patch1.diff is now on top
@@ -249,6 +246,3 @@
        $ cat patches/series
        > patch1.diff
        > patchR.diff
-
-       $ cd ..
-       $ rm -rf d
--- a/test/import2.test
+++ b/test/import2.test
@@ -1,8 +1,6 @@
 # same as import.test, but with compressed patches
 
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt new patch1.diff
        > Patch %{P}patch1.diff is now on top
@@ -138,6 +136,3 @@
 
        $ quilt delete patch1.diff.gz
        > Patch patch1.diff.gz is not in series
-
-       $ cd ..
-       $ rm -rf d
--- a/test/mail.test
+++ b/test/mail.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > no-subject
        < Here goes a longer description of the patch, which is
@@ -92,6 +90,3 @@
        > Subject: [test 5/6] Subject of 5.diff
        > From address@hidden
        > Subject: [test 6/6] Must not expand * ? [abc]
-
-       $ cd ..
-       $ rm -rf d
--- a/test/merge.test
+++ b/test/merge.test
@@ -1,8 +1,6 @@
 Test the patch merging functionality of `quilt diff'.
 
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > abc.txt
        < a
@@ -43,7 +41,7 @@ Test the patch merging functionality of 
 
        $ quilt diff -P b.diff | grep -v "^\\(---\\|+++\\)"
        > Warning: more recent patches modify files in patch %{P}b.diff
-       > Index: d/abc.txt
+       >~ Index: [^/]+/abc\.txt
        > ===================================================================
        > @@ -1,3 +1,3 @@
        >  a+
@@ -53,7 +51,7 @@ Test the patch merging functionality of 
 
        $ quilt diff --combine a.diff -P b.diff | grep -v "^\\(---\\|+++\\)"
        > Warning: more recent patches modify files in patch %{P}b.diff
-       > Index: d/abc.txt
+       >~ Index: [^/]+/abc\.txt
        > ===================================================================
        > @@ -1,3 +1,3 @@
        > -a
@@ -63,7 +61,7 @@ Test the patch merging functionality of 
        >  c
 
        $ quilt diff --combine b.diff | grep -v "^\\(---\\|+++\\)"
-       > Index: d/abc.txt
+       >~ Index: [^/]+/abc\.txt
        > ===================================================================
        > @@ -1,3 +1,3 @@
        >  a+
@@ -73,7 +71,7 @@ Test the patch merging functionality of 
        > +c+
 
        $ quilt diff --combine - | grep -v "^\\(---\\|+++\\)"
-       > Index: d/abc.txt
+       >~ Index: [^/]+/abc\.txt
        > ===================================================================
        > @@ -1,3 +1,3 @@
        > -a
@@ -82,6 +80,3 @@ Test the patch merging functionality of 
        > +a+
        > +b+
        > +c+
-
-       $ cd ..
-       $ rm -rf d
--- a/test/missing.test
+++ b/test/missing.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > patches/series
        < missing1.diff
@@ -20,6 +18,3 @@
        > Patch %{P}missing3.diff appears to be empty, removing
        > Patch patches/missing1.diff appears to be empty, removing
        > No patches applied
-       
-       $ cd ..
-       $ rm -rf d
--- a/test/new-nosubdir.test
+++ b/test/new-nosubdir.test
@@ -1,11 +1,6 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ mkdir sub
        $ cd sub
        $ quilt new here.diff
        > Patch %{_P}here.diff is now on top
-
-       $ cd ../..
-       $ rm -rf d
--- a/test/new.test
+++ b/test/new.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ echo reject > f
        $ echo p.diff > patches/series
@@ -33,22 +31,19 @@
        > Applied patch %{P}p.diff (forced; needs refresh)
 
        $ echo new > f
-       $ quilt refresh
+       $ quilt refresh -p ab
        > Refreshed patch %{P}p.diff
        $ cat patches/p.diff
-       > Index: d/f
+       > Index: b/f
        > ===================================================================
-       > --- d.orig/f
-       > +++ d/f
+       > --- a/f
+       > +++ b/f
        > @@ -1 +1 @@
        > -reject
        > +new
-       > Index: d/g
+       > Index: b/g
        > ===================================================================
        > --- /dev/null
-       > +++ d/g
+       > +++ b/g
        > @@ -0,0 +1 @@
        > +added
-
-       $ cd ..
-       $ rm -rf d
--- a/test/nolink.test
+++ b/test/nolink.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
 # quilt should preserve hard links and not create new ones
        $ echo foo > foo
@@ -72,6 +70,3 @@
        $ quilt pop -q
        > Removing patch patches/test.diff
        > No patches applied
-
-       $ cd ..
-       $ rm -rf d
--- a/test/null-bug.test
+++ b/test/null-bug.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ echo file > file
        $ quilt new remove.diff
@@ -31,6 +29,3 @@ or else patch won't know the real origin
        $ quilt push -q
        > Applying patch patches/remove.diff
        > Now at patch patches/remove.diff
-       
-       $ cd ..
-       $ rm -r d
--- a/test/one.test
+++ b/test/one.test
@@ -5,9 +5,8 @@ of the installed quilt with `make check'
 
 (To run, type `./run one.test' in this directory.)
 
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
+
        $ mkdir dir
        $ echo "This is file one." > dir/file1
        $ quilt new patch1.diff
@@ -25,19 +24,19 @@ of the installed quilt with `make check'
        > Nothing in patch %{P}patch1.diff
 
        $ echo "This is file two." > file2
-       $ quilt diff
-       > Index: d/file2
+       $ quilt diff -p ab
+       > Index: b/file2
        > ===================================================================
        > --- /dev/null
-       > +++ d/file2
+       > +++ b/file2
        > @@ -0,0 +1 @@
        > +This is file two.
 
-       $ quilt diff -z
-       > Index: d/file2
+       $ quilt diff -z -p ab
+       > Index: b/file2
        > ===================================================================
        > --- /dev/null
-       > +++ d/file2
+       > +++ b/file2
        > @@ -0,0 +1 @@
        > +This is file two.
 
@@ -46,20 +45,20 @@ of the installed quilt with `make check'
 
        $ quilt diff -z
        $ echo "Another line has been added." >> dir/file1
-       $ quilt diff -z
-       > Index: d/dir/file1
+       $ quilt diff -z -p ab
+       > Index: b/dir/file1
        > ===================================================================
-       > --- d.orig/dir/file1
-       > +++ d/dir/file1
+       > --- a/dir/file1
+       > +++ b/dir/file1
        > @@ -1 +1,2 @@
        >  This is file one.
        > +Another line has been added.
 
-       $ quilt diff -z dir/file1
-       > Index: d/dir/file1
+       $ quilt diff -z -p ab dir/file1
+       > Index: b/dir/file1
        > ===================================================================
-       > --- d.orig/dir/file1
-       > +++ d/dir/file1
+       > --- a/dir/file1
+       > +++ b/dir/file1
        > @@ -1 +1,2 @@
        >  This is file one.
        > +Another line has been added.
@@ -106,10 +105,10 @@ of the installed quilt with `make check'
        > File file4 added to patch %{P}subdir/patch3.diff
 
        $ rm -f file4
-       $ quilt diff
-       > Index: d/file4
+       $ quilt diff -p ab
+       > Index: b/file4
        > ===================================================================
-       > --- d.orig/file4
+       > --- a/file4
        > +++ /dev/null
        > @@ -1 +0,0 @@
        > -This is file 4.
@@ -125,11 +124,11 @@ of the installed quilt with `make check'
        > Refreshed patch %{P}patch2.diff
 
        $ echo "Another line added." >> file2
-       $ quilt diff -z -P patch1
-       > Index: d/file2
+       $ quilt diff -z -P patch1 -p ab
+       > Index: b/file2
        > ===================================================================
-       > --- d.orig/file2
-       > +++ d/file2
+       > --- a/file2
+       > +++ b/file2
        > @@ -1 +1,2 @@
        >  This is file two.
        > +Another line added.
@@ -155,6 +154,3 @@ of the installed quilt with `make check'
        > Removing patch %{P}patch2.diff
        > Removing patch %{P}patch1.diff
        > No patches applied
-
-       $ cd ..
-       $ rm -rf d
--- a/test/patch-wrapper.test
+++ b/test/patch-wrapper.test
@@ -1,6 +1,4 @@
-$ rm -rf d
-$ mkdir -p d/somewhere
-$ cd d
+$ mkdir somewhere
 
 $ cat > foo.orig
 < 1
@@ -69,6 +67,3 @@ $ quilt pop -q
 > Removing patch patches/somewhere/foo.diff
 > No patches applied
 $ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ cd ..
-$ rm -rf d
--- a/test/perms.test
+++ b/test/perms.test
@@ -1,7 +1,6 @@
-       $ rm -rf d
        $ umask 022
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
+
        $ echo foo > foo
        $ chmod 704 foo
        $ ls -l foo | awk '{ print $1,$NF }'
@@ -55,6 +54,3 @@ the backup file.
        $ quilt pop -q
        > Removing patch %{P}test2.diff
        > Now at patch %{P}test.diff
-
-       $ cd ..
-       $ rm -rf d
--- a/test/refresh-z.test
+++ b/test/refresh-z.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt new test.diff
        > Patch patches/test.diff is now on top
@@ -24,6 +22,3 @@
        > patches/test.diff
        > patches/test-2.diff
        > patches/baz.diff
-
-       $ cd ..
-       $ rm -rf d
--- a/test/rename.test
+++ b/test/rename.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > announce.txt
        < A short summary of the fixes are below.
@@ -57,6 +55,3 @@
        $ quilt pop -q
        > Removing patch %{P}newsubdir/final.name.diff
        > No patches applied
-
-       $ cd ..
-       $ rm -rf d
--- a/test/revert.test
+++ b/test/revert.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ mkdir sub
        $ echo f1 > sub/f
@@ -50,6 +48,3 @@
        > Changes to sub/h in patch ../patches/p.diff reverted
 
        $ quilt diff -z
-
-       $ cd ../..
-       $ rm -rf d
--- a/test/revert2.test
+++ b/test/revert2.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt new revert.patch
        > Patch patches/revert.patch is now on top
@@ -25,6 +23,3 @@
 
        $ quilt refresh
        > Patch patches/revert.patch is unchanged
-
-       $ cd ..
-       $ rm -rf d
--- a/test/setup.test
+++ b/test/setup.test
@@ -1,6 +1,5 @@
-$ rm -rf d
-$ mkdir -p d/dir
-$ cd d
+$ mkdir dir
+
 $ echo 1 > dir/foo.orig
 $ echo 2 > dir/foo
 $ diff -u dir/foo.orig dir/foo > foo.diff
@@ -48,5 +47,3 @@ $ ls -l patches series | sed -e 's:.* ->
 $ quilt push -qa
 > Applying patch patches/foo.diff
 > Now at patch patches/foo.diff
-$ cd ..
-$ rm -rf d
--- a/test/snapshot.test
+++ b/test/snapshot.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt new snapshot
        > Patch %{P}snapshot is now on top
@@ -35,19 +33,16 @@
        > Refreshed patch %{P}snapshot-2
 
        $ quilt diff --snapshot | grep -v "^\\(---\\|+++\\)"
-       > Index: d/f.txt
+       >~ Index: [^/]+/f\.txt
        > ===================================================================
        > @@ -1 +1,2 @@
        >  f.txt
        > +more changes
-       > Index: d/g.txt
+       >~ Index: [^/]+/g\.txt
        > ===================================================================
        > @@ -1 +0,0 @@
        > -g.txt
-       > Index: d/h.txt
+       >~ Index: [^/]+/h\.txt
        > ===================================================================
        > @@ -0,0 +1 @@
        > +h.txt
-       
-       $ cd ..
-       $ rm -rf d
--- a/test/snapshot2.test
+++ b/test/snapshot2.test
@@ -1,6 +1,5 @@
-       $ rm -rf d
-       $ mkdir -p d/patches d/d
-       $ cd d
+       $ mkdir patches d
+
        $ quilt new snapshot
        > Patch %{P}snapshot is now on top
 
@@ -35,19 +34,16 @@
        > Refreshed patch %{_P}snapshot-2
 
        $ quilt diff --snapshot | grep -v "^\\(---\\|+++\\)"
-       > Index: d/d/f.txt
+       >~ Index: [^/]+/d/f\.txt
        > ===================================================================
        > @@ -1 +1,2 @@
        >  f.txt
        > +more changes
-       > Index: d/d/g.txt
+       >~ Index: [^/]+/d/g\.txt
        > ===================================================================
        > @@ -1 +0,0 @@
        > -g.txt
-       > Index: d/d/h.txt
+       >~ Index: [^/]+/d/h\.txt
        > ===================================================================
        > @@ -0,0 +1 @@
        > +h.txt
-       
-       $ cd ../..
-       $ rm -rf d
--- a/test/sort.test
+++ b/test/sort.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ quilt new sort.diff
        > Patch patches/sort.diff is now on top
@@ -27,9 +25,9 @@
        > f
 
        $ quilt diff | grep '^Index'
-       > Index: d/b
-       > Index: d/f
-       > Index: d/c
+       >~ Index: [^/]+/b
+       >~ Index: [^/]+/f
+       >~ Index: [^/]+/c
 
        $ quilt add z x
        > File z added to patch patches/sort.diff
@@ -45,11 +43,11 @@
        > z
 
        $ quilt diff | grep '^Index'
-       > Index: d/b
-       > Index: d/f
-       > Index: d/c
-       > Index: d/x
-       > Index: d/z
+       >~ Index: [^/]+/b
+       >~ Index: [^/]+/f
+       >~ Index: [^/]+/c
+       >~ Index: [^/]+/x
+       >~ Index: [^/]+/z
 
        $ quilt add a
        > File a added to patch patches/sort.diff
@@ -64,42 +62,39 @@
        > z
 
        $ quilt diff | grep '^Index'
-       > Index: d/b
-       > Index: d/f
-       > Index: d/c
-       > Index: d/a
-       > Index: d/x
-       > Index: d/z
+       >~ Index: [^/]+/b
+       >~ Index: [^/]+/f
+       >~ Index: [^/]+/c
+       >~ Index: [^/]+/a
+       >~ Index: [^/]+/x
+       >~ Index: [^/]+/z
 
        $ quilt refresh
        > Refreshed patch patches/sort.diff
 
        $ grep '^Index' patches/sort.diff
-       > Index: d/b
-       > Index: d/f
-       > Index: d/c
-       > Index: d/a
-       > Index: d/x
-       > Index: d/z
+       >~ Index: [^/]+/b
+       >~ Index: [^/]+/f
+       >~ Index: [^/]+/c
+       >~ Index: [^/]+/a
+       >~ Index: [^/]+/x
+       >~ Index: [^/]+/z
 
        $ quilt diff --sort | grep '^Index'
-       > Index: d/a
-       > Index: d/b
-       > Index: d/c
-       > Index: d/f
-       > Index: d/x
-       > Index: d/z
+       >~ Index: [^/]+/a
+       >~ Index: [^/]+/b
+       >~ Index: [^/]+/c
+       >~ Index: [^/]+/f
+       >~ Index: [^/]+/x
+       >~ Index: [^/]+/z
 
        $ quilt refresh --sort
        > Refreshed patch patches/sort.diff
 
        $ grep '^Index' patches/sort.diff
-       > Index: d/a
-       > Index: d/b
-       > Index: d/c
-       > Index: d/f
-       > Index: d/x
-       > Index: d/z
-       
-       $ cd ..
-       $ rm -rf d
+       >~ Index: [^/]+/a
+       >~ Index: [^/]+/b
+       >~ Index: [^/]+/c
+       >~ Index: [^/]+/f
+       >~ Index: [^/]+/x
+       >~ Index: [^/]+/z
--- a/test/space-in-filenames.test
+++ b/test/space-in-filenames.test
@@ -1,6 +1,5 @@
-$ rm -rf d
-$ mkdir -p d/patches
-$ cd d
+$ mkdir patches
+
 $ quilt new test.diff
 >Patch patches/test.diff is now on top
 
@@ -38,6 +37,3 @@ $quilt remove "foo bar"
 
 $ quilt files
 > foo
-
-$ cd ..
-$ rm -rf d
--- a/test/subdir.test
+++ b/test/subdir.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ mkdir subdir
        $ cat > subdir/file
@@ -39,29 +37,26 @@
        > + subdir/file2
        > - subdir/file3
 
-       $ quilt diff
-       > Index: d/subdir/file
+       $ quilt diff -p ab
+       > Index: b/subdir/file
        > ===================================================================
-       > --- d.orig/subdir/file
-       > +++ d/subdir/file
+       > --- a/subdir/file
+       > +++ b/subdir/file
        > @@ -1 +1 @@
        > -old file
        > +new contents
-       > Index: d/subdir/file2
+       > Index: b/subdir/file2
        > ===================================================================
        > --- /dev/null
-       > +++ d/subdir/file2
+       > +++ b/subdir/file2
        > @@ -0,0 +1 @@
        > +another file
-       > Index: d/subdir/file3
+       > Index: b/subdir/file3
        > ===================================================================
-       > --- d.orig/subdir/file3
+       > --- a/subdir/file3
        > +++ /dev/null
        > @@ -1 +0,0 @@
        > -yet another file
 
        $ quilt refresh
        > Refreshed patch %{_P}test.patch
-
-       $ cd ../..
-       $ rm -rf d
--- a/test/three.test
+++ b/test/three.test
@@ -1,7 +1,4 @@
-
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ touch e
        $ quilt annotate e
@@ -137,17 +134,17 @@
        $ quilt push
        > File series fully applied, ends at patch patches/patch2.diff
 
-       $ quilt diff --combine patch1 -P patch2
-       > Index: d/f
+       $ quilt diff --combine patch1 -P patch2 -p ab
+       > Index: b/f
        > ===================================================================
        > --- /dev/null
-       > +++ d/f
+       > +++ b/f
        > @@ -0,0 +1 @@
        > +f
-       > Index: d/g
+       > Index: b/g
        > ===================================================================
        > --- /dev/null
-       > +++ d/g
+       > +++ b/g
        > @@ -0,0 +1 @@
        > +g
 
@@ -168,6 +165,3 @@
 
        $ quilt pop patch4.diff
        > Patch patch4.diff is not in series
-
-       $ cd ..
-       $ rm -rf d
--- a/test/trailing-ws.test
+++ b/test/trailing-ws.test
@@ -1,6 +1,4 @@
-       $ rm -rf d
-       $ mkdir -p d/patches
-       $ cd d
+       $ mkdir patches
 
        $ cat > a
        < a
@@ -77,6 +75,3 @@
        $ quilt pop -q
        > Removing patch patches/test2.diff
        > No patches applied
-
-       $ cd ..
-       $ rm -rf d
--- a/test/two.test
+++ b/test/two.test
@@ -1,8 +1,7 @@
 (To run, type `./run two.test' in this directory.)
 
-       $ rm -rf d
-       $ mkdir -p d/patches d/d
-       $ cd d
+       $ mkdir patches d
+
        $ quilt new patch1.diff
        > Patch %{P}patch1.diff is now on top
 
@@ -21,19 +20,19 @@
        > Nothing in patch %{_P}patch1.diff
 
        $ echo "This is file two." > file2
-       $ quilt diff
-       > Index: d/d/file2
+       $ quilt diff -p ab
+       > Index: b/d/file2
        > ===================================================================
        > --- /dev/null
-       > +++ d/d/file2
+       > +++ b/d/file2
        > @@ -0,0 +1 @@
        > +This is file two.
 
-       $ quilt diff -z
-       > Index: d/d/file2
+       $ quilt diff -z -p ab
+       > Index: b/d/file2
        > ===================================================================
        > --- /dev/null
-       > +++ d/d/file2
+       > +++ b/d/file2
        > @@ -0,0 +1 @@
        > +This is file two.
 
@@ -42,21 +41,21 @@
 
        $ quilt diff -z
        $ echo "Another line has been added." >> dir/file1
-       $ quilt diff -z
-       > Index: d/d/dir/file1
+       $ quilt diff -z -p ab
+       > Index: b/d/dir/file1
        > ===================================================================
-       > --- d.orig/d/dir/file1
-       > +++ d/d/dir/file1
+       > --- a/d/dir/file1
+       > +++ b/d/dir/file1
        > @@ -1 +1,2 @@
        >  This is file one.
        > +Another line has been added.
 
        $ cd dir
-       $ quilt diff -z file1
-       > Index: d/d/dir/file1
+       $ quilt diff -z file1 -p ab
+       > Index: b/d/dir/file1
        > ===================================================================
-       > --- d.orig/d/dir/file1
-       > +++ d/d/dir/file1
+       > --- a/d/dir/file1
+       > +++ b/d/dir/file1
        > @@ -1 +1,2 @@
        >  This is file one.
        > +Another line has been added.
@@ -109,10 +108,10 @@
        > File d/file4 added to patch %{_P}subdir/patch3.diff
 
        $ rm -f file4
-       $ quilt diff
-       > Index: d/d/file4
+       $ quilt diff -p ab
+       > Index: b/d/file4
        > ===================================================================
-       > --- d.orig/d/file4
+       > --- a/d/file4
        > +++ /dev/null
        > @@ -1 +0,0 @@
        > -This is file 4.
@@ -128,11 +127,11 @@
        > Refreshed patch %{_P}patch2.diff
 
        $ echo "Another line added." >> file2
-       $ quilt diff -z -P patch1
-       > Index: d/d/file2
+       $ quilt diff -z -P patch1 -p ab
+       > Index: b/d/file2
        > ===================================================================
-       > --- d.orig/d/file2
-       > +++ d/d/file2
+       > --- a/d/file2
+       > +++ b/d/file2
        > @@ -1 +1,2 @@
        >  This is file two.
        > +Another line added.
@@ -158,6 +157,3 @@
        > Removing patch %{_P}patch2.diff
        > Removing patch %{_P}patch1.diff
        > No patches applied
-
-       $ cd ../..
-       $ rm -rf d

-- 
Jean Delvare
Suse L3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]