6 # XXX this could be further munged to enable some parts on other
8 unless ($^O =~ /^MSWin/) {
9 print "1..0 # skipped: windows specific test\n";
24 my $testdir = "t e s t";
25 my $exename = "showav";
26 my $plxname = "showargv";
30 open(my $F, ">$testdir/$exename.c")
31 or die "Can't create $testdir/$exename.c: $!";
35 main(int ac, char **av)
38 for (i = 0; i < ac; i++)
39 printf("[%s]", av[i]);
45 open($F, ">$testdir/$plxname.bat")
46 or die "Can't create $testdir/$plxname.bat: $!";
50 if "%OS%" == "Windows_NT" goto WinNT
54 "$^X" -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
60 if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
61 if %errorlevel% == 9009 echo You do not have Perl in your PATH.
62 if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
67 print "[$_]" for ($0, @ARGV);
75 # build the executable
81 if (open(my $EIN, "$cwd/op/${exename}_exe.uu")) {
82 print "# Unpacking $exename.exe\n";
86 $e = unpack "u", <$EIN>;
89 open my $EOUT, ">$exename.exe" or die "Can't write $exename.exe: $!";
95 print "# Compiling $exename.c\n";
96 if (system("$Config{cc} $Config{ccflags} $exename.c 2>&1 >nul") != 0) {
97 print "# Could not compile $exename.c, status $?\n"
98 ."# Where is your C compiler?\n"
99 ."1..0 # skipped: can't build test executable\n";
102 copy("$plxname.bat","$plxname.cmd");
105 open my $T, "$^X -I../lib -w op/system_tests |"
106 or die "Can't spawn op/system_tests: $!";
115 elsif (/^#+\s(.*)$/) {
120 $expect =~ tr/<>/[]/;
121 $expect =~ s/\Q$plxname\E]/$plxname.bat]/;
125 print "# $comment\n" if $comment;
126 print "# want: $expect\n";
127 print "# got : $_\n";