----- Original Message ----- From: "Sisyphus"

Attached is a patch to t/plplot_library_tests.t that enables it to run on Windows.

Duh ... here it is.

Cheers,
Rob
--- t/plplot_library_tests.t_orig       Sat Sep  3 15:10:20 2011
+++ t/plplot_library_tests.t    Sat Sep  3 15:17:14 2011
@@ -10,6 +10,7 @@
use PDL::Config;
use PDL::Graphics::PLplot;
use Test::More;
+use File::Spec;

######################### End of black magic.

@@ -42,15 +43,27 @@

  # Compile C version
  unlink ("a.out");
+  if($^O =~ /MSWin32/i) {
+    my $cmd = $plversion->{'C_COMPILE'};
+    my $cc = $Config::Config{'cc'};
+    $cmd =~ s/\\/\//g; # Convert all backslashes to forward slashes
+    $cmd =~ s/\Q$cc\E/\Q$cc $c_code\E/; # Insert source file into the command
+    $cmd =~ s/\\//g;   # Remove all backskashes
+    system("$cmd -o a.out");
+  }
+  else {
  system "LD_RUN_PATH=\"$plversion->{'PLPLOT_LIB'}\" $plversion->{'C_COMPILE'} 
$c_code -o a.out";
+  }
  ok ((($? == 0) && -s "a.out"), "$c_code compiled successfully");

  # Run C version
-  system "a.out -dev svg -o x${num}c.svg -fam > /dev/null 2>&1";
+  my $devnull = File::Spec->devnull();
+  system "a.out -dev svg -o x${num}c.svg -fam > $devnull 2>&1";
  ok ($? == 0, "C code $c_code ran successfully");

  # Run perl version
-  system "$plplot_test_script -dev svg -o x${num}p.svg -fam > /dev/null 2>&1";
+  my $perlrun = $^O =~ /MSWin32/i ? 'perl -Mblib' : '';
+  system "$perlrun $plplot_test_script -dev svg -o x${num}p.svg -fam > $devnull 
2>&1";
  ok ($? == 0, "Script $plplot_test_script ran successfully");
  my @output = glob ("x${num}p.svg*");
  foreach my $outfile (@output) {
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to