2 # Copyright (C) 2007, The Perl Foundation.
8 use Test::More tests => 12;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::auto::macports');
14 use Parrot::Configure;
15 use Parrot::Configure::Options qw( process_options );
16 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 use IO::CaptureOutput qw( capture );
19 my $args = process_options( {
20 argv => [ q{--verbose} ],
24 my $conf = Parrot::Configure->new();
26 test_step_thru_runstep($conf, q{init::defaults}, $args);
28 my ($task, $step_name, $step, $ret);
29 my $pkg = q{auto::macports};
31 $conf->add_steps($pkg);
32 $conf->options->set(%{$args});
33 $task = $conf->steps->[-1];
34 $step_name = $task->step;
36 $step = $step_name->new();
37 ok(defined $step, "$step_name constructor returned defined value");
38 isa_ok($step, $step_name);
41 my $osname = 'foobar';
42 $conf->data->set_p5( 'OSNAME' => $osname );
44 my ($stdout, $stderr);
45 my $ret = capture sub { $step->runstep($conf) }, \$stdout, \$stderr;
46 ok($ret, "runstep() returned true value");
47 is($step->result(), q{skipped}, "Got expected result for non-Darwin OS");
50 qr/^Operating system is $osname; Macports is Darwin only/,
51 "Got expected verbose output"
55 pass("Completed all tests in $0");
57 ################### DOCUMENTATION ###################
61 auto_macports-01.t - test config::auto::macports
65 % prove t/steps/auto_macports-01.t
69 The files in this directory test functionality used by F<Configure.pl>.
71 The tests in this file test config::auto::macports in the case where the OS is not
72 Darwin and verbose output has been requested.
80 config::auto::macports, F<Configure.pl>.
86 # cperl-indent-level: 4
89 # vim: expandtab shiftwidth=4: