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