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