tagged release 0.6.4
[parrot.git] / t / steps / auto_attributes-01.t
blobea0e664b0cae34376b402c3959196456b3299f75
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_attributes-01.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::attributes');
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( {
19     argv            => [ ],
20     mode            => q{configure},
21 } );
23 my $conf = Parrot::Configure->new();
25 test_step_thru_runstep($conf, q{init::defaults}, $args);
27 my ($task, $step_name, $step, $ret);
28 my $pkg = q{auto::attributes};
30 $conf->add_steps($pkg);
31 $conf->options->set(%{$args});
32 $task = $conf->steps->[-1];
33 $step_name   = $task->step;
35 $step = $step_name->new();
36 ok(defined $step, "$step_name constructor returned defined value");
37 isa_ok($step, $step_name);
38 ok($step->description(), "$step_name has description");
41     my $rv;
42     my $stdout;
43     capture(
44         sub { $rv = $step->runstep($conf); },
45         \$stdout,
46     );
47     ok( defined $rv, "$step_name runstep() returned defined value" );
48     unlike($conf->data->get('ccflags'),
49         qr/HASATTRIBUTE_NEVER_WORKS/,
50         "'ccflags' excludes bogus attribute as expected"
51     );
54 pass("Completed all tests in $0");
56 ################### DOCUMENTATION ###################
58 =head1 NAME
60 auto_attributes-01.t - test config::auto::attributes
62 =head1 SYNOPSIS
64     % prove t/steps/auto_attributes-01.t
66 =head1 DESCRIPTION
68 The files in this directory test functionality used by F<Configure.pl>.
70 The tests in this file test subroutines exported by config::auto::attributes.
72 =head1 AUTHOR
74 James E Keenan
76 =head1 SEE ALSO
78 config::auto::attributes, 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: