Upgrade to ExtUtils::MakeMaker 6.37_02
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / xs.t
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
14 use Test::More;
15 use MakeMaker::Test::Utils;
16 use MakeMaker::Test::Setup::XS;
17 use File::Find;
18 use File::Spec;
19 use File::Path;
20
21 if( have_compiler() ) {
22     plan tests => 7;
23 }
24 else {
25     plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler";
26 }
27
28 my $Is_VMS = $^O eq 'VMS';
29 my $perl = which_perl();
30
31 # GNV logical interferes with testing
32 $ENV{'bin'} = '[.bin]' if $Is_VMS;
33
34 chdir 't';
35
36 perl_lib;
37
38 $| = 1;
39
40 ok( setup_xs(), 'setup' );
41 END {
42     ok( chdir File::Spec->updir );
43     ok( teardown_xs(), 'teardown' );
44 }
45
46 ok( chdir('XS-Test'), "chdir'd to XS-Test" ) ||
47   diag("chdir failed: $!");
48
49 my @mpl_out = run(qq{$perl Makefile.PL});
50
51 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
52   diag(@mpl_out);
53
54 my $make = make_run();
55 my $make_out = run("$make");
56 is( $?, 0,                                 '  make exited normally' ) || 
57     diag $make_out;
58
59 my $test_out = run("$make");
60 is( $?, 0,                                 '  make test exited normally' ) || 
61     diag $test_out;