add --quiet to silence noisy tests
authorRobin Barker <rmbarker@cpan.org>
Tue, 7 Feb 2012 20:13:41 +0000 (20:13 +0000)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 12 Feb 2012 22:41:23 +0000 (14:41 -0800)
The ext/Pod-Html tests generate warnings that appear in the output.
This patch adds --quiet to the function call to silence the
warnings, without (I hope) changing the point of the tests.

ext/Pod-Html/t/feature.t
ext/Pod-Html/t/feature2.t
ext/Pod-Html/t/htmldir1.t
ext/Pod-Html/t/htmldir2.t
ext/Pod-Html/t/htmldir3.t
ext/Pod-Html/t/htmldir4.t
ext/Pod-Html/t/htmldir5.t
ext/Pod-Html/t/htmlview.t

index 5f27454..79cd164 100644 (file)
@@ -20,6 +20,7 @@ convert_n_test("feature", "misc pod-html features",
  "--podpath=t",
  "--podroot=$cwd",
  "--title=a title",
+ "--quiet",
  
  );
 
index feeb84f..105d420 100644 (file)
@@ -7,10 +7,13 @@ BEGIN {
 
 use strict;
 use Cwd;
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 my $cwd = cwd();
 
+my $warn;
+$SIG{__WARN__} = sub { $warn .= $_[0] };
+
 convert_n_test("feature2", "misc pod-html features 2", 
  "--backlink",
  "--header",
@@ -18,8 +21,16 @@ convert_n_test("feature2", "misc pod-html features 2",
  "--podroot=$cwd",
  "--norecurse",
  "--verbose",
+ "--quiet",
  );
 
+like($warn,
+    qr(
+       \Acaching\ directories\ for\ later\ use\n
+       Converting\ input\ file\ \S+/feature2\.pod\n\z  
+    )x,
+    "misc pod-html --verbose warnings");
+
 __DATA__
 <?xml version="1.0" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
index a0e747f..a8c367a 100644 (file)
@@ -31,6 +31,7 @@ SKIP: {
      "--podpath=". catdir($relcwd, 't') . ":" . catfile($relcwd, 'testdir/test.lib'),
      "--podroot=$v". File::Spec->rootdir,
      "--htmldir=t",
+     "--quiet",
     );
 
     seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same)
@@ -38,8 +39,9 @@ SKIP: {
     convert_n_test("htmldir1", "test --htmldir and --htmlroot 1b", 
      "--podpath=$relcwd",
      "--podroot=$v". File::Spec->rootdir,
-     "--htmldir=". catfile $relcwd, 't',
+     "--htmldir=". catdir($relcwd, 't'),
      "--htmlroot=/",
+     "--quiet",
     );
 }
 
index b5f5b48..d1add48 100644 (file)
@@ -14,12 +14,14 @@ my $data_pos = tell DATA; # to read <DATA> twice
 convert_n_test("htmldir2", "test --htmldir and --htmlroot 2a", 
  "--podpath=t",
  "--htmldir=t",
+ "--quiet",
 );
 
 seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same)
 
 convert_n_test("htmldir2", "test --htmldir and --htmlroot 2b", 
  "--podpath=t",
+ "--quiet",
 );
 
 seek DATA, $data_pos, 0; # to read <DATA> thrice (expected output is the same)
@@ -29,6 +31,7 @@ convert_n_test("htmldir2", "test --htmldir and --htmlroot 2c",
  "--podpath=t",
  "--podroot=$cwd",
  "--norecurse", # testing --norecurse, too
+ "--quiet",
 );
 
 __DATA__
index 805c9d9..555dc74 100644 (file)
@@ -28,6 +28,7 @@ SKIP: {
      "--podpath=$relcwd",
      "--podroot=$v". File::Spec->rootdir,
      "--htmldir=". catdir($cwd, 't', ''), # test removal trailing slash,
+     "--quiet",
     );
 
     seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same)
@@ -37,6 +38,7 @@ SKIP: {
      "--podroot=$v". File::Spec->rootdir,
      "--htmldir=t",
      "--outfile=t/htmldir3.html",
+     "--quiet",
     );
 }
 
index 034fffe..1ebcecd 100644 (file)
@@ -16,6 +16,7 @@ convert_n_test("htmldir4", "test --htmldir and --htmlroot 4a",
  "--podpath=t",
  "--htmldir=t",
  "--outfile=". catfile('t', 'htmldir4.html'),
+ "--quiet",
 );
 
 seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same)
@@ -25,6 +26,7 @@ convert_n_test("htmldir4", "test --htmldir and --htmlroot 4b",
  "--podroot=$cwd",
  "--htmldir=". catdir($cwd, 't'),
  "--norecurse",
+ "--quiet",
 );
 
 __DATA__
index 15a3901..d9b6a6b 100644 (file)
@@ -28,6 +28,7 @@ SKIP: {
      "--podroot=$cwd",
      "--htmldir=$cwd",
      "--htmlroot=/",
+     "--quiet",
     );
 }
 
index 97e0536..bbfc971 100644 (file)
@@ -7,7 +7,7 @@ BEGIN {
 use strict;
 use Test::More tests => 1;
 
-convert_n_test("htmlview", "html rendering");
+convert_n_test("htmlview", "html rendering", "--quiet");
 
 __DATA__
 <?xml version="1.0" ?>