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