diff options
author | Nikola Knezevic <indy@tesla.rcub.bg.ac.yu> | 2002-04-26 17:38:16 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-26 17:11:30 +0000 |
commit | 946f19addb8b03454f49bf8bcfb27910b2445065 (patch) | |
tree | 81f55f3816b563ef75bce359aec02d1c0d0075a9 /t/win32 | |
parent | 27cc4b77ede2bf280aa5664f629885c111259aa9 (diff) | |
download | perl-946f19addb8b03454f49bf8bcfb27910b2445065.tar.gz |
system_tests are relevant only to win32\system.t
Message-ID: <14316006107.20020426153816@tesla.rcub.bg.ac.yu>
p4raw-id: //depot/perl@16193
Diffstat (limited to 't/win32')
-rw-r--r-- | t/win32/system.t | 6 | ||||
-rw-r--r-- | t/win32/system_tests | 120 |
2 files changed, 123 insertions, 3 deletions
diff --git a/t/win32/system.t b/t/win32/system.t index 5384d7c279..c08fb13e04 100644 --- a/t/win32/system.t +++ b/t/win32/system.t @@ -96,7 +96,7 @@ chdir($testdir); 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 @@ unless (-x "$testdir/$exename.exe") { 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; diff --git a/t/win32/system_tests b/t/win32/system_tests new file mode 100644 index 0000000000..f73745ae8f --- /dev/null +++ b/t/win32/system_tests @@ -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; + } +} |