2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 32;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::auto::inline');
12 use Parrot::Configure::Options qw( process_options );
13 use Parrot::Configure::Step::Test;
14 use Parrot::Configure::Test qw(
15 test_step_constructor_and_description
17 use IO::CaptureOutput qw( capture );
19 ########### regular ###########
21 my ($args, $step_list_ref) = process_options(
28 my $conf = Parrot::Configure::Step::Test->new;
29 $conf->include_config_results( $args );
31 my $pkg = q{auto::inline};
33 $conf->add_steps($pkg);
35 my $serialized = $conf->pcfreeze();
37 $conf->options->set( %{$args} );
38 my $step = test_step_constructor_and_description($conf);
40 my $ret = $step->runstep($conf);
41 ok( $ret, "runstep() returned true value" );
43 $conf->replenish($serialized);
45 ########### --inline ###########
47 ($args, $step_list_ref) = process_options( {
48 argv => [ q{--inline} ],
51 $conf->options->set( %{$args} );
52 $step = test_step_constructor_and_description($conf);
53 $ret = $step->runstep($conf);
54 ok( $ret, "runstep() returned true value" );
56 $conf->replenish($serialized);
58 ########### _evaluate_inline() ###########
60 ($args, $step_list_ref) = process_options( {
64 $conf->options->set( %{$args} );
65 $step = test_step_constructor_and_description($conf);
67 ok($step->_evaluate_inline($conf, $test),
68 "_evaluate_inline() returned true value");
69 is($step->result, q{yes}, "Got expected result");
70 is($conf->data->get( 'inline' ), 1,
71 "'inline' attribute has expected value");
73 $conf->replenish($serialized);
75 ########### _evaluate_inline() ###########
77 ($args, $step_list_ref) = process_options( {
81 $conf->options->set( %{$args} );
82 $step = test_step_constructor_and_description($conf);
84 ok($step->_evaluate_inline($conf, $test),
85 "_evaluate_inline() returned true value");
86 is($step->result, q{no}, "Got expected result");
87 is($conf->data->get( 'inline' ), q{},
88 "'inline' attribute has expected value");
90 $conf->replenish($serialized);
92 ########### _evaluate_inline(); --verbose ###########
94 ($args, $step_list_ref) = process_options( {
95 argv => [ q{--verbose} ],
98 $conf->options->set( %{$args} );
99 $step = test_step_constructor_and_description($conf);
104 sub { $step->_evaluate_inline($conf, $test) },
107 ok($ret, "_evaluate_inline() returned true value");
108 is($step->result, q{yes}, "Got expected result");
109 is($conf->data->get( 'inline' ), 1,
110 "'inline' attribute has expected value");
113 $conf->replenish($serialized);
115 ########### _second_probe_for_inline(); _evaluate_inline() ###########
117 ($args, $step_list_ref) = process_options( {
119 mode => q{configure},
121 $conf->options->set( %{$args} );
122 $step = test_step_constructor_and_description($conf);
124 $test = $step->_second_probe_for_inline($conf, $test);
125 ok($step->_evaluate_inline($conf, $test),
126 "_evaluate_inline() returned true value");
128 pass("Completed all tests in $0");
130 ################### DOCUMENTATION ###################
134 auto/inline-01.t - test auto::inline
138 % prove t/steps/auto/inline-01.t
142 The files in this directory test functionality used by F<Configure.pl>.
144 The tests in this file test auto::inline.
152 config::auto::inline, F<Configure.pl>.
158 # cperl-indent-level: 4
161 # vim: expandtab shiftwidth=4: