Support for using uninstalled Test::NoWarnings (RT#82386)
[Config-Perl-V.git] / t / 10_base.t
blobb840ef58cd1c22134ae0815d75f7ef7404f16224
1 #!/pro/bin/perl
3 use strict;
4 use warnings;
6 BEGIN {
7 use Test::More;
8 my $tests = 9;
9 unless ($ENV{PERL_CORE}) {
10 require Test::NoWarnings;
11 Test::NoWarnings->import ();
12 $tests++;
15 plan tests => $tests;
17 use_ok ("Config::Perl::V");
20 ok (my $conf = Config::Perl::V::myconfig, "Read config");
21 for (qw( build environment config inc )) {
22 ok (exists $conf->{build}, "Has build entry");
24 is (lc $conf->{build}{osname}, lc $conf->{config}{osname}, "osname");
26 SKIP: {
27 # Test that the code that shells out to perl -V and parses the output
28 # gives the same results as the code that calls Config::* routines directly.
29 defined &Config::compile_date or
30 skip "This perl doesn't provide perl -V in the Config module", 2;
31 eval q{no warnings "redefine"; sub Config::compile_date { return undef }};
32 is (Config::compile_date (), undef, "Successfully overriden compile_date");
33 is_deeply (Config::Perl::V::myconfig, $conf,
34 "perl -V parsing code produces same result as the Config module");