2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 14;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::auto::cpu');
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 ########### --verbose ###########
21 my ($args, $step_list_ref) = process_options( {
22 argv => [ q{--verbose} ],
26 my $conf = Parrot::Configure::Step::Test->new;
27 $conf->include_config_results( $args );
30 my $serialized = $conf->pcfreeze();
33 $conf->add_steps($pkg);
34 $conf->options->set( %{$args} );
35 $step = test_step_constructor_and_description($conf);
37 $conf->data->set('cpuarch' => 'foobar');
40 sub { $ret = $step->runstep($conf); },
43 ok($ret, "runstep() returned true value" );
44 ok(! $step->result(), "Got (default) false result as expected");
45 like($stdout, qr/cpu hints = 'auto::cpu::foobar::auto'/s,
46 "Got expected verbose output");
47 like($stdout, qr/no cpu specific hints/s,
48 "Got expected verbose output");
51 $conf->replenish($serialized);
52 $conf->options->set( 'verbose' => undef );
54 ########### mock cpuarch ###########
56 ($args, $step_list_ref) = process_options( {
61 $conf->add_steps($pkg);
62 $conf->options->set( %{$args} );
63 $step = test_step_constructor_and_description($conf);
64 $conf->data->set('cpuarch' => 'foobar');
65 my $ret = $step->runstep($conf);
66 ok($ret, "runstep() returned true value" );
67 ok(! $step->result(), "Got (default) false result as expected");
69 pass("Completed all tests in $0");
71 ################### DOCUMENTATION ###################
75 auto/cpu-01.t - test auto::cpu
79 % prove t/steps/auto/cpu-01.t
83 The files in this directory test functionality used by F<Configure.pl>.
85 The tests in this file test auto::cpu.
93 config::auto::cpu, F<Configure.pl>.
99 # cperl-indent-level: 4
102 # vim: expandtab shiftwidth=4: