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";
29 die "Could not create '$testdir':$!" unless -d $testdir;
31 open(my $F, ">$testdir/$exename.c")
32 or die "Can't create $testdir/$exename.c: $!";
36 main(int ac, char **av)
39 for (i = 0; i < ac; i++)
40 printf("[%s]", av[i]);
46 open($F, ">$testdir/$plxname.bat")
47 or die "Can't create $testdir/$plxname.bat: $!";
51 if "%OS%" == "Windows_NT" goto WinNT
55 "$^X" -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
61 if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
62 if %errorlevel% == 9009 echo You do not have Perl in your PATH.
63 if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
68 print "[$_]" for ($0, @ARGV);
76 # build the executable
82 if (open(my $EIN, "$cwd/op/${exename}_exe.uu")) {
83 print "# Unpacking $exename.exe\n";
87 $e = unpack "u", <$EIN>;
90 open my $EOUT, ">$exename.exe" or die "Can't write $exename.exe: $!";
97 if ($Config{cc} eq 'gcc')
99 $minus_o = "-o $exename.exe";
101 print "# Compiling $exename.c\n# $Config{cc} $Config{ccflags} $exename.c\n";
102 if (system("$Config{cc} $Config{ccflags} $minus_o $exename.c >log 2>&1") != 0) {
103 print "# Could not compile $exename.c, status $?\n"
104 ."# Where is your C compiler?\n"
105 ."1..0 # skipped: can't build test executable\n";
108 unless (-f "$exename.exe") {
109 if (open(LOG,'<log'))
116 warn "Cannot open log (in $testdir):$!";
120 copy("$plxname.bat","$plxname.cmd");
122 unless (-x "$testdir/$exename.exe") {
123 print "# Could not build $exename.exe\n"
124 ."1..0 # skipped: can't build test executable\n";
128 open my $T, "$^X -I../lib -w op/system_tests |"
129 or die "Can't spawn op/system_tests: $!";
138 elsif (/^#+\s(.*)$/) {
143 $expect =~ tr/<>/[]/;
144 $expect =~ s/\Q$plxname\E]/$plxname.bat]/;
148 print "# $comment\n" if $comment;
149 print "# want: $expect\n";
150 print "# got : $_\n";