2 # Copyright (C) 2007, The Perl Foundation.
10 use lib qw( lib t/configure/testlib );
11 use Parrot::Configure;
12 use Parrot::Configure::Options qw( process_options );
13 use Parrot::Configure::Test qw( test_step_thru_runstep);
14 use Parrot::Configure::Utils qw( capture_output );
16 my ($stdout, $stderr, $ret);
17 eval { ($stdout, $stderr, $ret) =
18 capture_output( qw| icu-config --exists | ); };
20 plan skip_all => "icu-config not available";
26 use_ok('config::init::defaults');
27 use_ok('config::auto::icu');
28 use IO::CaptureOutput qw( capture );
30 my $args = process_options(
34 q{--icuheaders=alpha},
41 my $conf = Parrot::Configure->new;
43 test_step_thru_runstep( $conf, q{init::defaults}, $args );
45 my $pkg = q{auto::icu};
47 $conf->add_steps($pkg);
48 $conf->options->set( %{$args} );
50 my ( $task, $step_name, $step);
51 $task = $conf->steps->[-1];
52 $step_name = $task->step;
54 $step = $step_name->new();
55 ok( defined $step, "$step_name constructor returned defined value" );
56 isa_ok( $step, $step_name );
57 ok( $step->description(), "$step_name has description" );
60 my ($stdout, $stderr, $ret);
62 sub { $ret = $step->runstep($conf); },
66 ok(! defined $ret, "runstep() returned undefined value as expected");
67 like($stderr, qr/error: icuheaders not defined or invalid/s,
68 "Got expected warnings");
69 like($stderr, qr/Something is wrong with your ICU installation/s,
70 "Got expected warnings");
73 pass("Completed all tests in $0");
75 ################### DOCUMENTATION ###################
79 auto_icu-03.t - test config::auto::icu
83 % prove t/steps/auto_icu-03.t
87 The files in this directory test functionality used by F<Configure.pl>.
89 The tests in this file test config::auto::icu with command-line options
90 C<--icushared> and C<--icuheaders>.
98 config::auto::icu, F<Configure.pl>.
104 # cperl-indent-level: 4
107 # vim: expandtab shiftwidth=4: