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