[libgraph-writer-graphviz-perl] 01/06: Update Ian's changes to the test suite.

gregor herrmann gregoa at debian.org
Wed Oct 22 15:34:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libgraph-writer-graphviz-perl.

commit 2875131b3dc3f5f553bf45e5d715497f14f4ae3e
Author: gregor herrmann <gregoa at debian.org>
Date:   Wed Oct 22 17:00:45 2014 +0200

    Update Ian's changes to the test suite.
    
    Graphviz dot output has changed again, and textually comparing formatted
    strings is fragile. So switch from dot format to plain format. Update test
    utility function accordingly.
    
    Closes: #755328
---
 ...de-a-TestUtils.pl-containing-broken-out-l.patch |  96 --------------
 ...sts-Sort-the-keywords-in-the-graph-output.patch |  32 -----
 debian/patches/fix-test-suite.patch                | 139 +++++++++++++++++++++
 debian/patches/series                              |   3 +-
 4 files changed, 140 insertions(+), 130 deletions(-)

diff --git a/debian/patches/0001-Tests-Provide-a-TestUtils.pl-containing-broken-out-l.patch b/debian/patches/0001-Tests-Provide-a-TestUtils.pl-containing-broken-out-l.patch
deleted file mode 100644
index 3a3b02e..0000000
--- a/debian/patches/0001-Tests-Provide-a-TestUtils.pl-containing-broken-out-l.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From bcedbb978208ce08d35e8f317fed5b34695ac1ab Mon Sep 17 00:00:00 2001
-From: Ian Jackson <ijackson at chiark.greenend.org.uk>
-Date: Sat, 8 Feb 2014 17:18:34 +0000
-Subject: [PATCH 1/4] Tests: Provide a TestUtils.pl containing broken-out
- launder() function
-
-The code for laundering font sizes was duplicated between the tests.
-Instead, break it out into a common function launder() in a new file
-t/TestUtils.pl (which exists just for the tests).
-
-Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
-
-squash! Tests: Provide a Test.pm containing
----
- MANIFEST       | 1 +
- t/1.simple.t   | 6 +++---
- t/2.ioall.t    | 7 ++++---
- t/TestUtils.pl | 8 ++++++++
- 4 files changed, 16 insertions(+), 6 deletions(-)
- create mode 100644 t/TestUtils.pl
-
-diff --git a/MANIFEST b/MANIFEST
-index 749c521..68c47e7 100644
---- a/MANIFEST
-+++ b/MANIFEST
-@@ -14,3 +14,4 @@ README
- t/0.use.t
- t/1.simple.t
- t/2.ioall.t
-+t/TestUtils.pl
-diff --git a/t/1.simple.t b/t/1.simple.t
-index 952a07b..66fb1e2 100644
---- a/t/1.simple.t
-+++ b/t/1.simple.t
-@@ -6,6 +6,7 @@ use Test::Simple tests => 1;
- use IO::All;
- use Graph;
- use Graph::Writer::GraphViz;
-+require 't/TestUtils.pl';
- 
- my @v = qw/Alice Bob Crude Dr/;
- my $g = Graph->new;
-@@ -17,9 +18,8 @@ $wr->write_graph($g,'t/graph.simple.dot');
- $/ = undef;
- my $g1 = <DATA>;
- my $g2 = io('t/graph.simple.dot')->slurp;
--# Ignore font-sizes, it's system-dependant
--$g1 =~ s/\d+/0/g;
--$g2 =~ s/\d+/0/g;
-+launder(\$g1);
-+launder(\$g2);
- ok($g1 eq $g2);
- unlink('t/graph.simple.dot');
- 
-diff --git a/t/2.ioall.t b/t/2.ioall.t
-index f18fff8..a489445 100644
---- a/t/2.ioall.t
-+++ b/t/2.ioall.t
-@@ -6,6 +6,7 @@ use Test::Simple tests => 2;
- use IO::All;
- use Graph;
- use Graph::Writer::GraphViz;
-+require 't/TestUtils.pl';
- 
- my @v = qw/Alice Bob Crude Dr/;
- my $g = Graph->new;
-@@ -25,9 +26,9 @@ $g2 = $io->slurp;
- }
- 
- ok(-f 't/graph.ioall.dot');
--# Ignore font-sizes, it's system-dependant
--$g1 =~ s/\d+/0/g;
--$g2 =~ s/\d+/0/g;
-+
-+launder(\$g1);
-+launder(\$g2);
- ok($g1 eq $g2);
- $io->unlink;
- 
-diff --git a/t/TestUtils.pl b/t/TestUtils.pl
-new file mode 100644
-index 0000000..4fec3d3
---- /dev/null
-+++ b/t/TestUtils.pl
-@@ -0,0 +1,8 @@
-+
-+sub launder ($) {
-+    my ($gr) = @_;
-+    # Ignore font-sizes, it's system-dependant
-+    $$gr =~ s/\d+/0/g;
-+}
-+
-+1;
--- 
-1.9.0.rc3
-
diff --git a/debian/patches/0002-Tests-Sort-the-keywords-in-the-graph-output.patch b/debian/patches/0002-Tests-Sort-the-keywords-in-the-graph-output.patch
deleted file mode 100644
index 0fd6513..0000000
--- a/debian/patches/0002-Tests-Sort-the-keywords-in-the-graph-output.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From c0818e59eab55ace2b177d0ea88682c81d2830aa Mon Sep 17 00:00:00 2001
-From: Ian Jackson <ijackson at chiark.greenend.org.uk>
-Date: Sat, 8 Feb 2014 17:22:45 +0000
-Subject: [PATCH 2/4] Tests: Sort the keywords in the graph output
-
-They come out in hash order which is not necessarily stable.
-Fixes FTBFS with perl 5.18 (Debian #711446, CPAN #85950).
-
-Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
----
- t/TestUtils.pl | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/t/TestUtils.pl b/t/TestUtils.pl
-index 4fec3d3..9338667 100644
---- a/t/TestUtils.pl
-+++ b/t/TestUtils.pl
-@@ -3,6 +3,11 @@ sub launder ($) {
-     my ($gr) = @_;
-     # Ignore font-sizes, it's system-dependant
-     $$gr =~ s/\d+/0/g;
-+    # Sort the keywords in the graph output, as they come out
-+    # in hash order which isn't necessarily stable.
-+    $$gr =~ s{((?:\s+.*\n)+)}{
-+        join "\n", sort split /\n/, $1
-+    }ge;
- }
- 
- 1;
--- 
-1.9.0.rc3
-
diff --git a/debian/patches/fix-test-suite.patch b/debian/patches/fix-test-suite.patch
new file mode 100644
index 0000000..3435d5d
--- /dev/null
+++ b/debian/patches/fix-test-suite.patch
@@ -0,0 +1,139 @@
+Description: Fix testsuite.
+- Tests: Provide a TestUtils.pl containing broken-out
+  launder() function
+  The code for laundering font sizes was duplicated between the tests.
+  Instead, break it out into a common function launder() in a new file
+  t/TestUtils.pl (which exists just for the tests).
+  (iwj)
+- Tests: Sort the keywords in the graph output
+  They come out in hash order which is not necessarily stable.
+  Fixes FTBFS with perl 5.18 (Debian #711446, CPAN #85950).
+  (iwj)
+- Tests: switch from dot to plain format
+  GraphViz dot output has changed again, causing new build failures
+  (Debian #755328).
+  Use plain format instead of dot; textually comparing nested strings
+  is just too fragile.
+  Update t/TestUtils.pl's sorting fucntion.
+  (gregoa)
+Origin: vendor
+Bug: http://rt.cpan.org/Public/Bug/Display.html?id=85950
+Bug-Debian: https://bugs.debian.org/711446
+ https://bugs.debian.org/755328
+Forwarded: http://rt.cpan.org/Public/Bug/Display.html?id=85950
+Author: Ian Jackson <ijackson at chiark.greenend.org.uk>
+ gregor herrmann <gregoa at debian.org>
+Last-Update: 2014-10-22
+
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -14,3 +14,4 @@
+ t/0.use.t
+ t/1.simple.t
+ t/2.ioall.t
++t/TestUtils.pl
+--- a/t/1.simple.t
++++ b/t/1.simple.t
+@@ -6,31 +6,27 @@
+ use IO::All;
+ use Graph;
+ use Graph::Writer::GraphViz;
++require 't/TestUtils.pl';
+ 
+ my @v = qw/Alice Bob Crude Dr/;
+ my $g = Graph->new;
+ $g->add_vertices(@v);
+ 
+-my $wr = Graph::Writer::GraphViz->new(-format => 'dot');
++my $wr = Graph::Writer::GraphViz->new(-format => 'plain');
+ $wr->write_graph($g,'t/graph.simple.dot');
+ 
+ $/ = undef;
+ my $g1 = <DATA>;
+ my $g2 = io('t/graph.simple.dot')->slurp;
+-# Ignore font-sizes, it's system-dependant
+-$g1 =~ s/\d+/0/g;
+-$g2 =~ s/\d+/0/g;
++launder(\$g1);
++launder(\$g2);
+ ok($g1 eq $g2);
+ unlink('t/graph.simple.dot');
+ 
+ __DATA__
+-digraph test {
+-	graph [ratio=fill];
+-	node [label="\N", color=black];
+-	edge [color=black];
+-	graph [bb="0,0,290,52"];
+-	Bob [label=Bob, pos="27,26", width="0.75", height="0.50"];
+-	Dr [label=Dr, pos="99,26", width="0.75", height="0.50"];
+-	Alice [label=Alice, pos="174,26", width="0.83", height="0.50"];
+-	Crude [label=Crude, pos="256,26", width="0.94", height="0.50"];
+-}
++graph 1 4.3624 0.5
++node Crude 0.55065 0.25 1.1013 0.5 Crude solid ellipse black black
++node Dr 1.7312 0.25 0.75 0.5 Dr solid ellipse black black
++node Bob 2.759 0.25 0.79437 0.5 Bob solid ellipse black black
++node Alice 3.884 0.25 0.95686 0.5 Alice solid ellipse black black
++stop
+--- a/t/2.ioall.t
++++ b/t/2.ioall.t
+@@ -6,12 +6,13 @@
+ use IO::All;
+ use Graph;
+ use Graph::Writer::GraphViz;
++require 't/TestUtils.pl';
+ 
+ my @v = qw/Alice Bob Crude Dr/;
+ my $g = Graph->new;
+ $g->add_vertices(@v);
+ 
+-my $wr = Graph::Writer::GraphViz->new(-format => 'dot');
++my $wr = Graph::Writer::GraphViz->new(-format => 'plain');
+ my $io = io('t/graph.ioall.dot')->mode('w+')->assert;
+ $wr->write_graph($g, $io );
+ 
+@@ -25,20 +26,16 @@
+ }
+ 
+ ok(-f 't/graph.ioall.dot');
+-# Ignore font-sizes, it's system-dependant
+-$g1 =~ s/\d+/0/g;
+-$g2 =~ s/\d+/0/g;
++
++launder(\$g1);
++launder(\$g2);
+ ok($g1 eq $g2);
+ $io->unlink;
+ 
+ __DATA__
+-digraph test {
+-	graph [ratio=fill];
+-	node [label="\N", color=black];
+-	edge [color=black];
+-	graph [bb="0,0,290,52"];
+-	Bob [label=Bob, pos="27,26", width="0.75", height="0.50"];
+-	Dr [label=Dr, pos="99,26", width="0.75", height="0.50"];
+-	Alice [label=Alice, pos="174,26", width="0.83", height="0.50"];
+-	Crude [label=Crude, pos="256,26", width="0.94", height="0.50"];
+-}
++graph 1 4.3624 0.5
++node Crude 0.55065 0.25 1.1013 0.5 Crude solid ellipse black black
++node Dr 1.7312 0.25 0.75 0.5 Dr solid ellipse black black
++node Bob 2.759 0.25 0.79437 0.5 Bob solid ellipse black black
++node Alice 3.884 0.25 0.95686 0.5 Alice solid ellipse black black
++stop
+--- /dev/null
++++ b/t/TestUtils.pl
+@@ -0,0 +1,11 @@
++
++sub launder ($) {
++    my ($gr) = @_;
++    # Ignore font-sizes, it's system-dependant
++    $$gr =~ s/\d+/0/g;
++    # Sort the the graph output, as it comes out
++    # in hash order which isn't necessarily stable.
++    $$gr = join "\n", sort split /\n/, $$gr;
++}
++
++1;
diff --git a/debian/patches/series b/debian/patches/series
index 1499de3..5ab57d0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
-0001-Tests-Provide-a-TestUtils.pl-containing-broken-out-l.patch
-0002-Tests-Sort-the-keywords-in-the-graph-output.patch
+fix-test-suite.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libgraph-writer-graphviz-perl.git



More information about the Pkg-perl-cvs-commits mailing list