xref: /openbsd-src/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/miniperl.t (revision eac174f2741a08d8deb8aae59a7f778ef9b5d770)
1#!/usr/bin/perl -w
2
3# Test that we can build modules as miniperl.
4# This mostly means no XS modules.
5
6use strict;
7use warnings;
8use lib 't/lib';
9
10use Test::More;
11use Config;
12
13# In a BEGIN block so the END tests aren't registered.
14BEGIN {
15    plan skip_all => 'miniperl test only necessary for the perl core'
16      if !$ENV{PERL_CORE};
17
18    plan $ENV{PERL_CORE} && $Config{'usecrosscompile'}
19      ? (skip_all => 'cross-compiling and make not available')
20      : 'no_plan';
21}
22
23# Disable all XS from here on
24use MakeMaker::Test::NoXS;
25
26use ExtUtils::MakeMaker;
27
28use MakeMaker::Test::Utils;
29use MakeMaker::Test::Setup::BFD;
30
31my $perl     = which_perl();
32my $makefile = makefile_name();
33my $make     = make_run();
34
35
36# Setup our test environment
37{
38    chdir 't';
39
40    perl_lib;
41
42    ok( setup_recurs(), 'setup' );
43    END {
44        ok( chdir File::Spec->updir );
45        ok( teardown_recurs(), 'teardown' );
46    }
47
48    ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
49      diag("chdir failed: $!");
50}
51
52
53# Run make once
54{
55    run_ok(qq{$perl Makefile.PL});
56    run_ok($make);
57}
58