In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/125084908db87e2d5060f8a1a4bdc518004d54c0?hp=8a753380757ead7b856564fd8b22a477e9738cd1>

- Log -----------------------------------------------------------------
commit 125084908db87e2d5060f8a1a4bdc518004d54c0
Author: Steve Hay <[email protected]>
Date:   Wed Jun 12 18:11:29 2013 +0100

    Corrections to 0511665b4b
    
    - require './test.pl' in a BEGIN block, rather than use './test.pl'.
    - Ensure the tests are done in the same program that emits the plan()
      otherwise one copy of test.pl thinks tests were planned but not done
      and the other thinks tests were done without being planned.
    - Fix indentation.

M       t/win32/system.t
M       t/win32/system_tests

commit 0511665b4b04e5ba7bba14613845524d42f7e938
Author: Marcel Gruenauer <[email protected]>
Date:   Tue Jan 22 20:15:08 2013 +0100

    converted t/win32.t/system* to test.pl style

M       t/win32/system.t
M       t/win32/system_tests
-----------------------------------------------------------------------

Summary of changes:
 t/win32/system.t     |   41 ++++++++++++++++++++---------------------
 t/win32/system_tests |    7 +++++--
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/t/win32/system.t b/t/win32/system.t
index ba09210..a6a94cb 100644
--- a/t/win32/system.t
+++ b/t/win32/system.t
@@ -7,9 +7,12 @@ BEGIN {
     @INC = ('../lib', '../../lib');
     # XXX this could be further munged to enable some parts on other
     # platforms
+    require './test.pl';
+}
+
+BEGIN {
     unless ($^O =~ /^MSWin/) {
-       print "1..0 # skipped: windows specific test\n";
-       exit 0;
+        skip_all 'windows specific test';
     }
 }
 
@@ -81,7 +84,7 @@ END {
     chdir($cwd) && rmtree("$cwd/$testdir") if -d "$cwd/$testdir";
 }
 if (open(my $EIN, "$cwd/win32/${exename}_exe.uu")) {
-    print "# Unpacking $exename.exe\n";
+    note "Unpacking $exename.exe";
     my $e;
     {
        local $/;
@@ -99,18 +102,18 @@ else {
      {
       $minus_o = "-o $exename.exe";
      }
-    print "# Compiling $exename.c\n# $Config{cc} $Config{ccflags} 
$exename.c\n";
+    note "Compiling $exename.c";
+    note "$Config{cc} $Config{ccflags} $exename.c";
     if (system("$Config{cc} $Config{ccflags} $minus_o $exename.c >log 2>&1") 
!= 0) {
-       print "# Could not compile $exename.c, status $?\n"
-            ."# Where is your C compiler?\n"
-            ."1..0 # skipped: can't build test executable\n";
-       exit(0);
+       note "Could not compile $exename.c, status $?";
+    note "Where is your C compiler?";
+    skip_all "can't build test executable";
     }
     unless (-f "$exename.exe") {
        if (open(LOG,'<log'))
          {
           while(<LOG>) {
-            print "# ",$_;
+              note $_;
           } 
          }
         else {
@@ -121,20 +124,18 @@ else {
 copy("$plxname.bat","$plxname.cmd");
 chdir($cwd);
 unless (-x "$testdir/$exename.exe") {
-    print "# Could not build $exename.exe\n"
-        ."1..0 # skipped: can't build test executable\n";
-    exit(0);
+    note "Could not build $exename.exe";
+    skip_all "can't build test executable";
 }
 
 open my $T, "$^X -I../lib -w win32/system_tests |"
     or die "Can't spawn win32/system_tests: $!";
 my $expect;
 my $comment = "";
-my $test = 0;
 while (<$T>) {
     chomp;
-    if (/^1\.\./) {
-       print "$_\n";
+    if (s/^1\.\.//) {
+       plan $_;
     }
     elsif (/^#+\s(.*)$/) {
        $comment = $1;
@@ -146,13 +147,11 @@ while (<$T>) {
     }
     else {
        if ($expect ne $_) {
-           print "# $comment\n" if $comment;
-           print "# want: $expect\n";
-           print "# got : $_\n";
-           print "not ";
+           note $comment if $comment;
+           note "want: $expect";
+           note "got : $_";
        }
-       ++$test;
-       print "ok $test\n";
+       ok($expect eq $_);
     }
 }
 close $T;
diff --git a/t/win32/system_tests b/t/win32/system_tests
index f73745a..e2445ed 100644
--- a/t/win32/system_tests
+++ b/t/win32/system_tests
@@ -3,6 +3,9 @@
 use Config;
 use Cwd;
 use strict;
+BEGIN {
+    require './test.pl';
+}
 
 $| = 1;
 
@@ -90,7 +93,7 @@ for my $cmds (@commands) {
        my @all_args;
        my @cmds = defined($cmds) ? (ref($cmds) ? @$cmds : $cmds) : ();
        my @args = defined($args) ? (ref($args) ? @$args : $args) : ();
-       print "######## [@cmds]\n";
+       note "####### [@cmds]";
        print "<", join('><',
                        $cmds[$#cmds],
                        map { my $x = $_; $x =~ s/"//g; $x } @args),
@@ -106,7 +109,7 @@ for my $cmds (@commands) {
        $^D = 0;
        my $cmdstr = join " ", map { /\s|^$/ && !/\"/
                                    ? qq["$_"] : $_ } @cmds, @args;
-       print "######## '$cmdstr'\n";
+       note "####### '$cmdstr'";
        if (system($cmdstr) != 0) {
            print "Failed, status($?)\n";
            if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {

--
Perl5 Master Repository

Reply via email to