12 my $cwdb = my $cwd = cwd();
16 my $testdir = "t e s t";
17 my $exename = "showav";
18 my $plxname = "showargv";
20 my $exe = "$testdir/$exename";
21 my $exex = $exe . ".exe";
22 (my $exeb = $exe) =~ s,/,\\,g;
23 my $exebx = $exeb . ".exe";
25 my $bat = "$testdir/$plxname";
26 my $batx = $bat . ".bat";
27 (my $batb = $bat) =~ s,/,\\,g;
28 my $batbx = $batb . ".bat";
30 my $cmdx = $bat . ".cmd";
32 my $cmdbx = $cmdb . ".cmd";
70 [$^X, "$cwdb\\$batbx"],
85 ["", "\ta b c ", "abc"],
86 [" ", "\ta b c ", "abc"],
87 ['" "', 'a" "b" "c', "abc"],
90 print "1.." . (@commands * @av * 3) . "\n";
91 for my $cmds (@commands) {
94 my @cmds = defined($cmds) ? (ref($cmds) ? @$cmds : $cmds) : ();
95 my @args = defined($args) ? (ref($args) ? @$args : $args) : ();
96 note "####### [@cmds]";
99 map { my $x = $_; $x =~ s/"//g; $x } @args),
101 if (system(@cmds,@args) != 0) {
102 print "Failed, status($?)\n";
103 if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {
104 print "Running again in debug mode\n";
110 my $cmdstr = join " ", map { /\s|^$/ && !/\"/
111 ? qq["$_"] : $_ } @cmds, @args;
112 note "####### '$cmdstr'";
113 if (system($cmdstr) != 0) {
114 print "Failed, status($?)\n";
115 if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {
116 print "Running again in debug mode\n";
123 note "# pipe [".join(";", @cmds, @args). "]";
124 if (open my $io, "-|", @cmds, @args) {
129 print STDERR "Failed pipe open [",join(";", @cmds, @args),"]: $!\n";