Trim second block (nolinenumbers) to avert crashes on Win32.
authorJames E Keenan <jkeenan@cpan.org>
Sun, 18 Aug 2013 23:47:31 +0000 (01:47 +0200)
committerJames E Keenan <jkeenan@cpan.org>
Sun, 18 Aug 2013 23:47:31 +0000 (01:47 +0200)
In second block of tests, eliminate all tests except those needed to prove
that ParseXS can write a .c file without line numbers.  We will treat this as
sufficient because the tests we are deleting are causing crashes on Windows.

For: RT #119231

dist/ExtUtils-ParseXS/t/001-basic.t

index a2d3c6b..e6d9808 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use strict;
-use Test::More tests => 24;
+use Test::More tests => 17;
 use Config;
 use DynaLoader;
 use ExtUtils::CBuilder;
@@ -149,43 +149,6 @@ $pxs->process_file(
 );
 ok -e $source_file, "Create an output file";
 
-my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
-my $b = ExtUtils::CBuilder->new(quiet => $quiet);
-
-SKIP: {
-  skip "no compiler available", 2
-    if ! $b->have_compiler;
-  $obj_file = $b->compile( source => $source_file );
-  ok $obj_file, "ExtUtils::CBuilder::compile() returned true value";
-  ok -e $obj_file, "Make sure $obj_file exists";
-}
-
-SKIP: {
-  skip "no dynamic loading", 5
-    if !$b->have_compiler || !$Config{usedl};
-  my $module = 'XSTest';
-  $lib_file = $b->link( objects => $obj_file, module_name => $module );
-  ok $lib_file, "ExtUtils::CBuilder::link() returned true value";
-  ok -e $lib_file,  "Make sure $lib_file exists";
-
-  eval {require XSTest};
-  is $@, '', "No error message recorded, as expected";
-  ok  XSTest::is_even(8),
-    "Function created thru XS returned expected true value";
-  ok !XSTest::is_even(9),
-    "Function created thru XS returned expected false value";
-
-  # Win32 needs to close the DLL before it can unlink it, but unfortunately
-  # dl_unload_file was missing on Win32 prior to perl change #24679!
-  if ($^O eq 'MSWin32' and defined &DynaLoader::dl_unload_file) {
-    for (my $i = 0; $i < @DynaLoader::dl_modules; $i++) {
-      if ($DynaLoader::dl_modules[$i] eq $module) {
-        DynaLoader::dl_unload_file($DynaLoader::dl_librefs[$i]);
-        last;
-      }
-    }
-  }
-}
 
 my $seen = 0;
 open my $IN, '<', $source_file
@@ -196,7 +159,6 @@ while (my $l = <$IN>) {
 close $IN or die "Unable to close $source_file: $!";
 is( $seen, 0, "No linenumbers created in output file, as intended" );
 
-
 unless ($ENV{PERL_NO_CLEANUP}) {
   for ( $obj_file, $lib_file, $source_file) {
     next unless defined $_;