82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / t / xs.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     unshift @INC, 't/lib/';
5 }
6 chdir 't';
7
8 use strict;
9
10 use Test::More;
11 use MakeMaker::Test::Utils;
12 use MakeMaker::Test::Setup::XS;
13 use File::Find;
14 use File::Spec;
15 use File::Path;
16
17 my $Skipped = 0;
18 if( have_compiler() ) {
19     plan tests => 5;
20 }
21 else {
22     $Skipped = 1;
23     plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler";
24 }
25
26 my $Is_VMS = $^O eq 'VMS';
27 my $perl = which_perl();
28
29 chdir 't';
30
31 perl_lib;
32
33 $| = 1;
34
35 ok( setup_xs(), 'setup' );
36 END {
37     unless( $Skipped ) {
38         chdir File::Spec->updir or die;
39         teardown_xs(), 'teardown' or die;
40     }
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");
53 is( $?, 0,                                 '  make exited normally' ) || 
54     diag $make_out;
55
56 my $test_out = run("$make");
57 is( $?, 0,                                 '  make test exited normally' ) || 
58     diag $test_out;