This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update ExtUtils-MakeMaker to CPAN version 7.02
[perl5.git] / cpan / ExtUtils-MakeMaker / t / xs.t
CommitLineData
7292dc67
RGS
1#!/usr/bin/perl -w
2
3BEGIN {
b78fd716 4 unshift @INC, 't/lib/';
7292dc67
RGS
5}
6chdir 't';
7
5bdf71cc
RGS
8use strict;
9
7292dc67 10use MakeMaker::Test::Utils;
c8d65f10 11use MakeMaker::Test::Setup::XS;
c6ba1525
CBW
12use Test::More
13 have_compiler()
14 ? (tests => 5)
15 : (skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler");
c8d65f10 16use File::Spec;
7292dc67 17
c8d65f10
RGS
18my $Is_VMS = $^O eq 'VMS';
19my $perl = which_perl();
20
c8d65f10
RGS
21chdir 't';
22
23perl_lib;
24
25$| = 1;
26
27ok( setup_xs(), 'setup' );
28END {
c6ba1525
CBW
29 chdir File::Spec->updir or die;
30 teardown_xs(), 'teardown' or die;
c8d65f10
RGS
31}
32
33ok( chdir('XS-Test'), "chdir'd to XS-Test" ) ||
34 diag("chdir failed: $!");
35
36my @mpl_out = run(qq{$perl Makefile.PL});
88e24181
CBW
37SKIP: {
38 unless (cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' )) {
39 diag(@mpl_out);
40 skip 'perl Makefile.PL failed', 2;
41 }
42
43 my $make = make_run();
44 my $make_out = run("$make");
45 unless (is( $?, 0, ' make exited normally' )) {
46 diag $make_out;
47 skip 'Make failed - skipping test', 1;
48 }
49
50 my $test_out = run("$make test");
51 is( $?, 0, ' make test exited normally' ) ||
52 diag $test_out;
53}