summaryrefslogtreecommitdiff
path: root/dist/ExtUtils-CBuilder/t/00-have-compiler.t
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2010-12-15 10:47:14 -0500
committerDavid Golden <dagolden@cpan.org>2010-12-15 10:48:56 -0500
commit8ba25f7a636c7e234b1c5bc09aa0b35eaa143601 (patch)
treec95e76a857d4caa234f281a98884dee98b9eea40 /dist/ExtUtils-CBuilder/t/00-have-compiler.t
parentf1c605336053dab86b920ac27a6262e25665bc65 (diff)
downloadperl-8ba25f7a636c7e234b1c5bc09aa0b35eaa143601.tar.gz
Change ExtUtils::CBuilder upstream to blead
ExtUtils::CBuilder now has blead as its upstream repository. The distribution has been moved to the dist/ directory consistent with this change.
Diffstat (limited to 'dist/ExtUtils-CBuilder/t/00-have-compiler.t')
-rw-r--r--dist/ExtUtils-CBuilder/t/00-have-compiler.t57
1 files changed, 57 insertions, 0 deletions
diff --git a/dist/ExtUtils-CBuilder/t/00-have-compiler.t b/dist/ExtUtils-CBuilder/t/00-have-compiler.t
new file mode 100644
index 0000000000..581a21461b
--- /dev/null
+++ b/dist/ExtUtils-CBuilder/t/00-have-compiler.t
@@ -0,0 +1,57 @@
+#! perl -w
+
+use File::Spec;
+my $perl;
+BEGIN {
+ $perl = File::Spec->rel2abs($^X);
+}
+
+use strict;
+use Test::More;
+BEGIN {
+ if ($^O eq 'VMS') {
+ # So we can get the return value of system()
+ require vmsish;
+ import vmsish;
+ }
+}
+
+plan tests => 7;
+
+require_ok "ExtUtils::CBuilder";
+
+my $b = eval { ExtUtils::CBuilder->new(quiet => 1) };
+ok( $b, "got CBuilder object" ) or diag $@;
+
+my $bogus_path = 'djaadjfkadjkfajdf';
+my $run_perl = "$perl -e1 --";
+# test missing compiler
+$b->{config}{cc} = $bogus_path;
+$b->{config}{ld} = $bogus_path;
+
+$b->{have_cc} = undef;
+is( $b->have_compiler, 0, "have_compiler: fake missing cc" );
+$b->{have_cxx} = undef;
+is( $b->have_cplusplus, 0, "have_cplusplus: fake missing c++" );
+
+# test found compiler
+$b->{config}{cc} = $run_perl;
+$b->{config}{ld} = $run_perl;
+$b->{config}{cxx} = $run_perl;
+$b->{have_cc} = undef;
+is( $b->have_compiler, 1, "have_compiler: fake present cc" );
+$b->{have_cxx} = undef;
+is( $b->have_cplusplus, 1, "have_cpp_compiler: fake present c++" );
+
+# test missing cpp compiler
+
+# test one non-exported subroutine
+{
+ my $type = ExtUtils::CBuilder::os_type();
+ if ($type) {
+ pass( "OS type $type located for $^O" );
+ }
+ else {
+ pass( "OS type not yet listed for $^O" );
+ }
+}