2 # Copyright (C) 2007, The Perl Foundation.
8 use Test::More tests => 13;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::auto::env');
13 use Parrot::Configure;
14 use Parrot::Configure::Options qw( process_options );
15 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 my $args = process_options( {
22 my $conf = Parrot::Configure->new();
24 test_step_thru_runstep($conf, q{init::defaults}, $args);
26 my ($task, $step_name, $step, $ret);
27 my $pkg = q{auto::env};
29 $conf->add_steps($pkg);
30 $conf->options->set(%{$args});
31 $task = $conf->steps->[-1];
32 $step_name = $task->step;
34 $step = $step_name->new();
35 ok(defined $step, "$step_name constructor returned defined value");
36 isa_ok($step, $step_name);
39 my ($setenv, $unsetenv);
43 $step->_evaluate_env($conf, $setenv, $unsetenv);
44 is($step->result(), q{both}, "Got expected result");
48 $step->_evaluate_env($conf, $setenv, $unsetenv);
49 is($step->result(), q{setenv}, "Got expected result");
53 $step->_evaluate_env($conf, $setenv, $unsetenv);
54 is($step->result(), q{unsetenv}, "Got expected result");
58 $step->_evaluate_env($conf, $setenv, $unsetenv);
59 is($step->result(), q{no}, "Got expected result");
62 pass("Completed all tests in $0");
64 ################### DOCUMENTATION ###################
68 auto_env-02.t - test config::auto::env
72 % prove t/steps/auto_env-02.t
76 The files in this directory test functionality used by F<Configure.pl>.
78 The tests in this file test config::auto::env::_evaluate_env(), an
79 internal subroutine, in the various permutations of having or lacking
80 C<setenv> and C<unsetenv>.
88 config::auto::env, F<Configure.pl>.
94 # cperl-indent-level: 4
97 # vim: expandtab shiftwidth=4: