t/x2p/s2p.t fix for VMS in UNIX mode
[p5sagit/p5-mst-13.2.git] / t / win32 / system.t
index bd65412..fb7a1d1 100644 (file)
@@ -2,7 +2,9 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    @INC = '../lib';
+    # We need '../../lib' as well as '../lib' because parts of Config are
+    # delay-loaded, after we've chdir()'ed into $testdir.
+    @INC = ('../lib', '../../lib');
     # XXX this could be further munged to enable some parts on other
     # platforms
     unless ($^O =~ /^MSWin/) {
@@ -32,10 +34,28 @@ open(my $F, ">$testdir/$exename.c")
     or die "Can't create $testdir/$exename.c: $!";
 print $F <<'EOT';
 #include <stdio.h>
+#ifdef __BORLANDC__
+#include <windows.h>
+#endif
 int
 main(int ac, char **av)
 {
     int i;
+#ifdef __BORLANDC__
+    char *s = GetCommandLine();
+    int j=0;
+    av[0] = s;
+    if (s[0]=='"') {
+       for(;s[++j]!='"';)
+         ;
+       av[0]++;
+    }
+    else {
+       for(;s[++j]!=' ';)
+         ;
+    }
+    s[j]=0;
+#endif
     for (i = 0; i < ac; i++)
        printf("[%s]", av[i]);
     printf("\n");
@@ -78,7 +98,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;
     {
@@ -124,8 +144,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;