Commit | Line | Data |
7292dc67 |
1 | #!/usr/bin/perl -w |
2 | |
3 | BEGIN { |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't'; |
6 | @INC = ('../lib', 'lib/'); |
7 | } |
8 | else { |
9 | unshift @INC, 't/lib/'; |
10 | } |
11 | } |
12 | chdir 't'; |
13 | |
5bdf71cc |
14 | use strict; |
15 | |
7292dc67 |
16 | use Test::More; |
17 | use MakeMaker::Test::Utils; |
c8d65f10 |
18 | use MakeMaker::Test::Setup::XS; |
19 | use File::Find; |
20 | use File::Spec; |
21 | use File::Path; |
7292dc67 |
22 | |
5bdf71cc |
23 | my $Skipped = 0; |
7292dc67 |
24 | if( have_compiler() ) { |
a592ba15 |
25 | plan tests => 5; |
7292dc67 |
26 | } |
27 | else { |
5bdf71cc |
28 | $Skipped = 1; |
7292dc67 |
29 | plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler"; |
30 | } |
31 | |
c8d65f10 |
32 | my $Is_VMS = $^O eq 'VMS'; |
33 | my $perl = which_perl(); |
34 | |
c8d65f10 |
35 | chdir 't'; |
36 | |
37 | perl_lib; |
38 | |
39 | $| = 1; |
40 | |
41 | ok( setup_xs(), 'setup' ); |
42 | END { |
5bdf71cc |
43 | unless( $Skipped ) { |
44 | chdir File::Spec->updir or die; |
45 | teardown_xs(), 'teardown' or die; |
46 | } |
c8d65f10 |
47 | } |
48 | |
49 | ok( chdir('XS-Test'), "chdir'd to XS-Test" ) || |
50 | diag("chdir failed: $!"); |
51 | |
52 | my @mpl_out = run(qq{$perl Makefile.PL}); |
53 | |
54 | cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || |
55 | diag(@mpl_out); |
56 | |
57 | my $make = make_run(); |
58 | my $make_out = run("$make"); |
59 | is( $?, 0, ' make exited normally' ) || |
60 | diag $make_out; |
61 | |
62 | my $test_out = run("$make"); |
63 | is( $?, 0, ' make test exited normally' ) || |
64 | diag $test_out; |