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 / VERSION_FROM.t
CommitLineData
57b1a898
MS
1#!/usr/bin/perl -w
2
45bc4d3a
JH
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't' if -d 't';
6 @INC = ('../lib', 'lib');
7 }
8 else {
9 unshift @INC, 't/lib';
10 }
11}
12
13chdir 't';
14
15use strict;
16use Test::More tests => 1;
17use MakeMaker::Test::Utils;
18use ExtUtils::MakeMaker;
19use TieOut;
20use File::Path;
21
22perl_lib();
23
57b1a898 24mkdir('Odd-Version', 0777);
45bc4d3a
JH
25END { chdir File::Spec->updir; rmtree 'Odd-Version' }
26chdir 'Odd-Version';
27
28open(MPL, ">Version") || die $!;
29print MPL "\$VERSION = 0\n";
30close MPL;
31END { unlink 'Version' }
32
33my $stdout = tie *STDOUT, 'TieOut' or die;
34my $mm = WriteMakefile(
35 NAME => 'Version',
36 VERSION_FROM => 'Version'
37);
38
39is( $mm->{VERSION}, 0, 'VERSION_FROM when $VERSION = 0' );