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