1 package MakeMaker::Test::Setup::XS;
5 @EXPORT = qw(setup_xs teardown_xs);
10 use MakeMaker::Test::Utils;
12 my $Is_VMS = $^O eq 'VMS';
15 'XS-Test/lib/XS/Test.pm' => <<'END',
22 @ISA = qw(Exporter DynaLoader);
23 @EXPORT = qw(is_even);
25 bootstrap XS::Test $VERSION;
30 'XS-Test/Makefile.PL' => <<'END',
31 use ExtUtils::MakeMaker;
35 VERSION_FROM => 'lib/XS/Test.pm',
39 'XS-Test/Test.xs' => <<'END',
44 MODULE = XS::Test PACKAGE = XS::Test
50 RETVAL = (input % 2 == 0);
55 'XS-Test/t/is_even.t' => <<'END',
58 use Test::More tests => 3;
69 chdir 'MM_TEST_ROOT:[t]' if $Is_VMS;
71 while(my($file, $text) = each %Files) {
72 # Convert to a relative, native file path.
73 $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
75 my $dir = dirname($file);
77 open(FILE, ">$file") || die "Can't create $file: $!";
86 foreach my $file (keys %Files) {
87 my $dir = dirname($file);
89 rmtree($dir) || return;