Change 16193 by jhi@alpha on 2002/04/26 17:11:30

        Subject: [PATCH t\win32] system_tests are relevant only to win32\system.t
        From: Nikola Knezevic <[EMAIL PROTECTED]>
        Date: Fri, 26 Apr 2002 15:38:16 +0200
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/MANIFEST#862 edit
.... //depot/perl/t/op/system_tests#3 delete
.... //depot/perl/t/win32/system.t#4 edit
.... //depot/perl/t/win32/system_tests#1 add

Differences ...

==== //depot/perl/MANIFEST#862 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST.~1~   Fri Apr 26 11:15:05 2002
+++ perl/MANIFEST       Fri Apr 26 11:15:05 2002
@@ -2523,7 +2523,6 @@
 t/op/subst_wamp.t              See if substitution works with $& present
 t/op/sub_lval.t                        See if lvalue subroutines work
 t/op/sysio.t                   See if sysread and syswrite work
-t/op/system_tests              Test runner for system.t
 t/op/taint.t                   See if tainting works
 t/op/tie.t                     See if tie/untie functions work
 t/op/tiearray.t                        See if tie for arrays works
@@ -2599,6 +2598,7 @@
 t/uni/upper.t                  See if Unicode casing works
 t/win32/longpath.t             Test if Win32::GetLongPathName() works
 t/win32/system.t               See if system works in Win*
+t/win32/system_tests           Test runner for system.t
 t/x2p/s2p.t                    See if s2p/psed work
 taint.c                                Tainting code
 thrdvar.h                      Per-thread variables

==== //depot/perl/t/win32/system.t#4 (text) ====
Index: perl/t/win32/system.t
--- perl/t/win32/system.t.~1~   Fri Apr 26 11:15:05 2002
+++ perl/t/win32/system.t       Fri Apr 26 11:15:05 2002
@@ -96,7 +96,7 @@
 END {
     chdir($cwd) && rmtree("$cwd/$testdir") if -d "$cwd/$testdir";
 }
-if (open(my $EIN, "$cwd/op/${exename}_exe.uu")) {
+if (open(my $EIN, "$cwd/win32/${exename}_exe.uu")) {
     print "# Unpacking $exename.exe\n";
     my $e;
     {
@@ -142,8 +142,8 @@
     exit(0);
 }
 
-open my $T, "$^X -I../lib -w op/system_tests |"
-    or die "Can't spawn op/system_tests: $!";
+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;

==== //depot/perl/t/win32/system_tests#1 (text) ====
Index: perl/t/win32/system_tests
--- perl/t/win32/system_tests.~1~       Fri Apr 26 11:15:05 2002
+++ perl/t/win32/system_tests   Fri Apr 26 11:15:05 2002
@@ -0,0 +1,120 @@
+#!perl
+
+use Config;
+use Cwd;
+use strict;
+
+$| = 1;
+
+my $cwdb = my $cwd = cwd();
+$cwd =~ s,\\,/,g;
+$cwdb =~ s,/,\\,g;
+
+my $testdir = "t e s t";
+my $exename = "showav";
+my $plxname = "showargv";
+
+my $exe = "$testdir/$exename";
+my $exex = $exe . ".exe";
+(my $exeb = $exe) =~ s,/,\\,g;
+my $exebx = $exeb . ".exe";
+
+my $bat = "$testdir/$plxname";
+my $batx = $bat . ".bat";
+(my $batb = $bat) =~ s,/,\\,g;
+my $batbx = $batb . ".bat";
+
+my $cmdx = $bat . ".cmd";
+my $cmdb = $batb;
+my $cmdbx = $cmdb . ".cmd";
+
+my @commands = (
+  $exe,
+  $exex,
+  $exeb,
+  $exebx,
+  "./$exe",
+  "./$exex",
+  ".\\$exeb",
+  ".\\$exebx",
+  "$cwd/$exe",
+  "$cwd/$exex",
+  "$cwdb\\$exeb",
+  "$cwdb\\$exebx",
+  $bat,
+  $batx,
+  $batb,
+  $batbx,
+  "./$bat",
+  "./$batx",
+  ".\\$batb",
+  ".\\$batbx",
+  "$cwd/$bat",
+  "$cwd/$batx",
+  "$cwdb\\$batb",
+  "$cwdb\\$batbx",
+  $cmdx,
+  $cmdbx,
+  "./$cmdx",
+  ".\\$cmdbx",
+  "$cwd/$cmdx",
+  "$cwdb\\$cmdbx",
+  [$^X, $batx],
+  [$^X, $batbx],
+  [$^X, "./$batx"],
+  [$^X, ".\\$batbx"],
+  [$^X, "$cwd/$batx"],
+  [$^X, "$cwdb\\$batbx"],
+);
+
+my @av = (
+  undef,
+  "",
+  " ",
+  "abc",
+  "a b\tc",
+  "\tabc",
+  "abc\t",
+  " abc\t",
+  "\ta b c ",
+  ["\ta b c ", ""],
+  ["\ta b c ", " "],
+  ["", "\ta b c ", "abc"],
+  [" ", "\ta b c ", "abc"],
+  ['" "', 'a" "b" "c', "abc"],
+);
+
+print "1.." . (@commands * @av * 2) . "\n";
+for my $cmds (@commands) {
+    for my $args (@av) {
+       my @all_args;
+       my @cmds = defined($cmds) ? (ref($cmds) ? @$cmds : $cmds) : ();
+       my @args = defined($args) ? (ref($args) ? @$args : $args) : ();
+       print "######## [@cmds]\n";
+       print "<", join('><',
+                       $cmds[$#cmds],
+                       map { my $x = $_; $x =~ s/"//g; $x } @args),
+             ">\n";
+       if (system(@cmds,@args) != 0) {
+           print "Failed, status($?)\n";
+           if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {
+               print "Running again in debug mode\n";
+               $^D = 1; # -Dp
+               system(@cmds,@args);
+           }
+       }
+       $^D = 0;
+       my $cmdstr = join " ", map { /\s|^$/ && !/\"/
+                                   ? qq["$_"] : $_ } @cmds, @args;
+       print "######## '$cmdstr'\n";
+       if (system($cmdstr) != 0) {
+           print "Failed, status($?)\n";
+           if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {
+               print "Running again in debug mode\n";
+               $^D = 1; # -Dp
+               system($cmdstr);
+           }
+       }
+       $^D = 0;
+    }
+}
End of Patch.

Reply via email to