* t/pmc/complex.t:
[parrot.git] / t / steps / auto_funcptr-03.t
bloba8bd768d6ef635f157abdfdacb525d0ad17a359f
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_funcptr-03.t
6 use strict;
7 use warnings;
8 use Test::More tests => 12;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::auto::funcptr');
14 use Parrot::BuildUtil;
15 use Parrot::Configure;
16 use Parrot::Configure::Options qw( process_options );
17 use Parrot::Configure::Test qw( test_step_thru_runstep);
18 use IO::CaptureOutput qw| capture |;
20 my $args = process_options( {
21     argv            => [ q{--verbose} ],
22     mode            => q{configure},
23 } );
25 my $conf = Parrot::Configure->new();
27 test_step_thru_runstep($conf, q{init::defaults}, $args);
29 my ($task, $step_name, $step, $ret);
30 my $pkg = q{auto::funcptr};
32 $conf->add_steps($pkg);
33 $conf->options->set(%{$args});
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);
41 ok($step->description(), "$step_name has description");
44     my $stdout;
45     my $ret = capture(
46         sub { auto::funcptr::_set_positive_result($step, $conf); },
47         \$stdout,
48     );
49     is($step->result, q{yes}, "Got expected result");
50     like($stdout, qr/yes/, "Got expected verbose output");
53 pass("Completed all tests in $0");
55 ################### DOCUMENTATION ###################
57 =head1 NAME
59 auto_funcptr-03.t - test config::auto::funcptr
61 =head1 SYNOPSIS
63     % prove t/steps/auto_funcptr-03.t
65 =head1 DESCRIPTION
67 The files in this directory test functionality used by F<Configure.pl>.
69 The tests in this file test config::auto::funcptr in the case where the
70 C<--verbose> option has been set.
72 =head1 AUTHOR
74 James E Keenan
76 =head1 SEE ALSO
78 config::auto::funcptr, F<Configure.pl>.
80 =cut
82 # Local Variables:
83 #   mode: cperl
84 #   cperl-indent-level: 4
85 #   fill-column: 100
86 # End:
87 # vim: expandtab shiftwidth=4: