This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update CPANPLUS::Dist::Build to CPAN version 0.36
[perl5.git] / lib / ExtUtils / CBuilder / t / 00-have-compiler.t
CommitLineData
9015f106
DG
1#! perl -w
2
3BEGIN {
4 if ($ENV{PERL_CORE}) {
5 chdir 't' if -d 't';
6 chdir '../lib/ExtUtils/CBuilder'
7 or die "Can't chdir to lib/ExtUtils/CBuilder: $!";
8 @INC = qw(../..);
9 }
10}
11
12use strict;
13use Test::More;
14use File::Spec;
15BEGIN {
16 if ($^O eq 'VMS') {
17 # So we can get the return value of system()
18 require vmsish;
19 import vmsish;
20 }
21}
22
23plan tests => 4;
24
25require_ok "ExtUtils::CBuilder";
26
27my $b = eval { ExtUtils::CBuilder->new(quiet => 1) };
28ok( $b, "got CBuilder object" ) or diag $@;
29
30# test missing compiler
31$b->{config}{cc} = 'djaadjfkadjkfajdf';
32$b->{config}{ld} = 'djaadjfkadjkfajdf';
33is( $b->have_compiler, 0, "have_compiler: fake missing cc" );
34
35# test found compiler
36$b->{have_compiler} = undef;
37$b->{config}{cc} = "$^X -e1 --";
38$b->{config}{ld} = "$^X -e1 --";
39is( $b->have_compiler, 1, "have_compiler: fake present cc" );
40
41