2 # Copyright (C) 2007, Parrot Foundation.
10 use File::Temp qw( tempdir );
11 use Test::More tests => 7;
13 use IO::CaptureOutput qw| capture |;
14 use Parrot::Configure::Options qw| process_options |;
15 use Parrot::Configure::Options::Test;
17 my ( $args, $step_list_ref ) = process_options(
24 "process_options() returned successfully when options were specified" );
26 my $opttest = Parrot::Configure::Options::Test->new($args);
27 ok( defined $opttest, "Constructor returned successfully" );
29 # Running the actual pre- and post-configuration tests would be too
30 # time-consuming. So instead, we want to redefine the lists of tests to be
31 # run to include only dummy test files found in temporary directories.
35 my $teststring = <<"TEST";
36 use Test::More tests => 1;
38 pass("Dummy test passed");
43 my $tdir = tempdir( CLEANUP => 1 );
44 ok( ( chdir $tdir ), "Changed to temporary directory for testing" );
45 my $test = q{testfile};
46 open my $T, ">", $test
47 or die "Unable to open dummy test file for writing";
49 close $T or die "Unable to close dummy test file after writing";
53 my $reason = q{Devel::Cover gags on this test};
58 skip $reason, 1 if $ENV{PERL5OPT};
60 sub { $rv = $opttest->run_configure_tests($test); },
63 ok( $rv, "Configuration tests are runnable" );
70 skip $reason, 1 if $ENV{PERL5OPT};
72 sub { $rv = $opttest->run_build_tests($test); },
75 ok( $rv, "Build tests are runnable" );
78 unlink $test or croak "Unable to delete $test";
80 ok( ( chdir $cwd ), "Changed back to starting directory after testing" );
83 pass("Completed all tests in $0");
85 ################### DOCUMENTATION ###################
89 025-options_test.t - test Parrot::Configure::Options::Test
93 % prove t/configure/025-options_test.t
97 The files in this directory test functionality used by F<Configure.pl>.
99 The tests in this file test Parrot::Configure::Options::Test methods.
107 Parrot::Configure::Options, F<Configure.pl>.
113 # cperl-indent-level: 4
116 # vim: expandtab shiftwidth=4: