diff options
Diffstat (limited to 'cpan/ExtUtils-CBuilder/t/00-have-compiler.t')
-rw-r--r-- | cpan/ExtUtils-CBuilder/t/00-have-compiler.t | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cpan/ExtUtils-CBuilder/t/00-have-compiler.t b/cpan/ExtUtils-CBuilder/t/00-have-compiler.t new file mode 100644 index 0000000000..245bce571e --- /dev/null +++ b/cpan/ExtUtils-CBuilder/t/00-have-compiler.t @@ -0,0 +1,37 @@ +#! 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 => 4; + +require_ok "ExtUtils::CBuilder"; + +my $b = eval { ExtUtils::CBuilder->new(quiet => 1) }; +ok( $b, "got CBuilder object" ) or diag $@; + +# test missing compiler +$b->{config}{cc} = 'djaadjfkadjkfajdf'; +$b->{config}{ld} = 'djaadjfkadjkfajdf'; +is( $b->have_compiler, 0, "have_compiler: fake missing cc" ); + +# test found compiler +$b->{have_compiler} = undef; +$b->{config}{cc} = "$perl -e1 --"; +$b->{config}{ld} = "$perl -e1 --"; +is( $b->have_compiler, 1, "have_compiler: fake present cc" ); + + |