ExtUtils::MakeMaker 6.55_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 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 chdir 't';
36
37 perl_lib;
38
39 $| = 1;
40
41 ok( setup_xs(), 'setup' );
42 END {
43     unless( $Skipped ) {
44         chdir File::Spec->updir or die;
45         teardown_xs(), 'teardown' or die;
46     }
47 }
48
49 ok( chdir('XS-Test'), "chdir'd to XS-Test" ) ||
50   diag("chdir failed: $!");
51
52 my @mpl_out = run(qq{$perl Makefile.PL});
53
54 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
55   diag(@mpl_out);
56
57 my $make = make_run();
58 my $make_out = run("$make");
59 is( $?, 0,                                 '  make exited normally' ) || 
60     diag $make_out;
61
62 my $test_out = run("$make");
63 is( $?, 0,                                 '  make test exited normally' ) || 
64     diag $test_out;