Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

don't FAIL due to test count error on systems without lua

The skip count was always off on systems without lua. We said we
skipped 6 tests, but it was 3 where the URL wasn't =~ /failo/.

It's easier to just skip the entire test suite on those systems, so
move the prereq for lua before the plan.

Also don't run each of those tests 10 times. There's no need.
  • Loading branch information...
commit d6fd4f2f17697979da2513d4fbe76609a91099aa 1 parent 2fa0ddf
Ævar Arnfjörð Bjarmason authored October 12, 2010
10  Changes
@@ -2,6 +2,16 @@ Revision history for App::QuoteCC
2 2
 
3 3
 {{$NEXT}}
4 4
 
  5
+    - Don't FAIL due to test count error on systems without lua
  6
+    
  7
+      The skip count was always off on systems without lua. We said we
  8
+      skipped 6 tests, but it was 3 where the URL wasn't =~ /failo/.
  9
+    
  10
+      It's easier to just skip the entire test suite on those systems, so
  11
+      move the prereq for lua before the plan.
  12
+    
  13
+      Also don't run each of those tests 10 times. There's no need.
  14
+
5 15
 0.09 2010-09-23 08:54:47
6 16
 
7 17
     - Use the not-so-well-known dong string delimiting syntax in the
53  t/compile-quotes.t
@@ -5,11 +5,12 @@ use Encode;
5 5
 use File::Slurp qw(slurp);
6 6
 use File::Temp qw<tempdir tempfile>;
7 7
 
8  
-plan skip_all => "Need curl / gcc to test"
  8
+plan skip_all => "Need curl / gcc / lua to test"
9 9
     unless
10 10
         qx[ curl --version ] =~ /^curl \d+\..*\nProtocols:/s and
11  
-        qx[ gcc --version ]  =~ /Free Software Foundation/;
12  
-plan tests => 380;
  11
+        qx[ gcc --version ]  =~ /Free Software Foundation/ and
  12
+        qx[ lua -e 'require "posix"; print(string.format("The time is %s", os.time()));' ] =~ /^The time is \d+$/;
  13
+plan tests => 65;
13 14
 
14 15
 my @test = (
15 16
     {
@@ -59,46 +60,36 @@ for my $compiler (qw/Perl C Lua/) {
59 60
 
60 61
         given ($compiler) {
61 62
             when ('Lua') {
62  
-                for (1..10) {
63  
-                  SKIP: {
64  
-                    skip "Don't have a Lua on this system", 6
65  
-                        unless qx[ lua -e 'require "posix"; print(string.format("The time is %s", os.time()));' ] =~ /^The time is \d+$/;
66  
-                    system "chmod +x $output";
  63
+                system "chmod +x $output";
67 64
 
68  
-                    chomp(my $quote = qx[lua $output]);
69  
-                    ok($quote, "Got quote from $output");
  65
+                chomp(my $quote = qx[lua $output]);
  66
+                ok($quote, "Got quote from $output");
70 67
 
71  
-                    chomp($quote = qx[lua $output --all]);
72  
-                    ok($quote, "Got quote from $output --all");
73  
-                    test_quotes_encoding($output, $quote, $url);
74  
-                  }
75  
-                }
  68
+                chomp($quote = qx[lua $output --all]);
  69
+                ok($quote, "Got quote from $output --all");
  70
+                test_quotes_encoding($output, $quote, $url);
76 71
             }
77 72
             when ('C') {
78 73
                 $cmd = qq[gcc -Wall $output -o $output.exe];
79 74
                 system $cmd;
80 75
 
81  
-                for (1..10) {
82  
-                    chomp(my $quote = qx[$output.exe]);
83  
-                    ok($quote, "Got quote from $output.exe");
  76
+                chomp(my $quote = qx[$output.exe]);
  77
+                ok($quote, "Got quote from $output.exe");
84 78
 
85  
-                    chomp($quote = qx[$output.exe --all]);
86  
-                    ok($quote, "Got quote from $output.exe --all");
87  
-                    test_quotes_encoding($output, $quote, $url);
88  
-                }
  79
+                chomp($quote = qx[$output.exe --all]);
  80
+                ok($quote, "Got quote from $output.exe --all");
  81
+                test_quotes_encoding($output, $quote, $url);
89 82
             }
90 83
             when ('Perl') {
91  
-                for (1..10) {
92  
-                    my $raw = slurp($output);
93  
-                    unlike($raw, qr/require MIME::Base64/, "Data::Dump didn't use modules");
  84
+                my $raw = slurp($output);
  85
+                unlike($raw, qr/require MIME::Base64/, "Data::Dump didn't use modules");
94 86
 
95  
-                    chomp(my $quote = qx[$^X $output]);
96  
-                    ok($quote, "Got quote from $^X $output");
97  
-                    cmp_ok(length($quote), '>', 5, "quote was long enough");
  87
+                chomp(my $quote = qx[$^X $output]);
  88
+                ok($quote, "Got quote from $^X $output");
  89
+                cmp_ok(length($quote), '>', 5, "quote was long enough");
98 90
 
99  
-                    chomp($quote = qx[$^X $output --all]);
100  
-                    test_quotes_encoding($output, $quote, $url);
101  
-                }
  91
+                chomp($quote = qx[$^X $output --all]);
  92
+                test_quotes_encoding($output, $quote, $url);
102 93
             }
103 94
         }
104 95
     }

0 notes on commit d6fd4f2

Please sign in to comment.
Something went wrong with that request. Please try again.