This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don't compile or link in EU::CBuilder's base class testing.
authorCraig A. Berry <craigberry@mac.com>
Sat, 15 Jan 2011 18:45:15 +0000 (12:45 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sat, 15 Jan 2011 18:45:15 +0000 (12:45 -0600)
Remove the tests that try to send actual compile and link commands
to the shell and predict what their output will be.   That can't
be done portably in the base class -- that's what the overrides
are for.  Testing that properties get populated correctly and so
forth should be reasonably portable, though there is no guarantee
some of these won't be overridden as well (but leave them in for
now).

dist/ExtUtils-CBuilder/t/04-base.t

index 702e50e..5b235a5 100644 (file)
@@ -1,20 +1,18 @@
 #! perl -w
 
 use strict;
-use Test::More tests => 58;
-BEGIN { 
-  if ($^O eq 'VMS') {
-    # So we can get the return value of system()
-    require vmsish;
-    import vmsish;
-  }
-}
+use Test::More tests => 50;
 use Config;
 use Cwd;
 use File::Path qw( mkpath );
 use File::Temp qw( tempdir );
 use ExtUtils::CBuilder::Base;
 
+## N.B.  There are pretty severe limits on what can portably be tested
+## in the base class.  Specifically, don't do anything that will send
+## actual compile and link commands to the shell as that won't work
+## without the platform-specific overrides.
+
 # XXX protect from user CC as we mock everything here
 local $ENV{CC};
 
@@ -142,59 +140,7 @@ is( $base->object_file($source_file),
     "object_file(): got expected automatically assigned name for object file"
 );
 
-SKIP:
-{
-    skip "Base can't do real compile and link on VMS", 2
-       if $^O eq 'VMS';
-
-    # object filename explicitly assigned
-    $object_file = File::Spec->catfile('t', 'my_special_compilet.o' );
-    is( $object_file,
-        $base->compile(
-            source      => $source_file,
-            object_file => $object_file,
-        ),
-        "compile(): returned object file with specified name"
-    );
-
-    $lib_file = $base->lib_file($object_file);
-    ok( $lib_file, "lib_file() returned true value" );
-}
-
 my ($lib, @temps);
-SKIP:
-{
-    skip "Base can't link on Win32 or VMS", 4
-       if $^O eq "MSWin32" || $^O eq "VMS";
-    ($lib, @temps) = $base->link(
-       objects     => $object_file,
-       module_name => 'compilet',
-       );
-    $lib =~ tr/"'//d; #"
-    is($lib_file, $lib, "lib_file(): got expected value for $lib");
-
-    ($lib, @temps) = $base->link(
-       objects     => [ $object_file ],
-       module_name => 'compilet',
-    );
-    $lib =~ tr/"'//d; #"
-    is($lib_file, $lib, "lib_file(): got expected value for $lib");
-
-    ($lib, @temps) = $base->link(
-       lib_file    => $lib_file,
-       objects     => [ $object_file ],
-       module_name => 'compilet',
-    );
-    $lib =~ tr/"'//d; #"
-    is($lib_file, $lib, "lib_file(): got expected value for $lib");
-
-    $lib = $base->link(
-       objects     => $object_file,
-       module_name => 'compilet',
-    );
-    $lib =~ tr/"'//d; #"
-    is($lib_file, $lib, "lib_file(): got expected value for $lib");
-}
 
 
 {
@@ -212,30 +158,6 @@ isa_ok( $base, 'ExtUtils::CBuilder::Base' );
 $source_file = File::Spec->catfile('t', 'compilet.c');
 create_c_source_file($source_file);
 ok(-e $source_file, "source file '$source_file' created");
-SKIP:
-{
-    skip "Base can't do real compile and link on VMS", 2
-       if $^O eq 'VMS';
-
-    $object_file = File::Spec->catfile('t', 'my_special_compilet.o' );
-    is( $object_file,
-        $base->compile(
-            source      => $source_file,
-            object_file => $object_file,
-            defines     => { alpha => 'beta', gamma => 'delta' },
-        ),
-        "compile() completed when 'defines' provided; returned object file with specified name"
-    );
-
-    my $exe_file = $base->exe_file($object_file);
-    my $ext = $base->{config}{_exe};
-    my $expected = File::Spec->catfile('t', qq|my_special_compilet$ext| );
-    is(
-        $exe_file,
-        $expected,
-        "exe_file(): returned expected name of executable"
-    );
-}
 
 my %args = ();
 my @defines = $base->arg_defines( %args );