2 # Copyright (C) 2008, The Perl Foundation.
7 use Test::More tests => 16;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::auto::crypto');
13 use Parrot::Configure;
14 use Parrot::Configure::Options qw( process_options );
15 use Parrot::Configure::Test qw( test_step_thru_runstep);
16 use IO::CaptureOutput qw| capture |;
18 my $args = process_options(
20 argv => [ q{--without-crypto} ],
25 my $conf = Parrot::Configure->new;
27 test_step_thru_runstep( $conf, q{init::defaults}, $args );
29 my $pkg = q{auto::crypto};
31 $conf->add_steps($pkg);
32 $conf->options->set( %{$args} );
34 my ($task, $step_name, $step);
35 $task = $conf->steps->[-1];
36 $step_name = $task->step;
38 $step = $step_name->new();
39 ok( defined $step, "$step_name constructor returned defined value" );
40 isa_ok( $step, $step_name );
43 my ($test, $has_crypto, $verbose);
45 $test = qq{OpenSSL 0.9.9z\n};
48 $has_crypto = $step->_evaluate_cc_run($conf, $test, $has_crypto, $verbose);
49 is($has_crypto, 1, "'has_crypto' set as expected");
50 is($step->result(), 'yes, 0.9.9z', "Expected result was set");
51 # Prepare for next test
52 $step->set_result(undef);
57 $has_crypto = $step->_evaluate_cc_run($conf, $test, $has_crypto, $verbose);
58 is($has_crypto, 0, "'has_crypto' set as expected");
59 ok(! defined $step->result(), "Result is undefined, as expected");
63 $test = qq{OpenSSL 0.9.9z\n};
68 $step->_evaluate_cc_run($conf, $test, $has_crypto, $verbose); },
71 is($has_crypto, 1, "'has_crypto' set as expected");
72 is($step->result(), 'yes, 0.9.9z', "Expected result was set");
73 like($stdout, qr/\(yes\)/, "Got expected verbose output");
74 # Prepare for next test
75 $step->set_result(undef);
78 pass("Completed all tests in $0");
80 ################### DOCUMENTATION ###################
84 auto_crypto-03.t - test config::auto::crypto
88 % prove t/steps/auto_crypto-03.t
92 The files in this directory test functionality used by F<Configure.pl>.
94 The tests in this file test config::auto::crypto.
98 Mostly taken from F<t/steps/auto_gdbm-03.t>.
106 config::auto::crypto, F<Configure.pl>.
112 # cperl-indent-level: 4
115 # vim: expandtab shiftwidth=4: