tagged release 0.6.4
[parrot.git] / t / steps / auto_gc-01.t
blob4585a557f3a202d75be5b495397affe0aac378ad
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_gc-01.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  8;
9 use lib qw( lib t/configure/testlib );
10 use_ok('config::auto::gc');
11 use Parrot::Configure;
12 use Parrot::Configure::Options qw( process_options );
13 use Parrot::Configure::Test qw( test_step_thru_runstep);
14 use IO::CaptureOutput qw| capture |;
16 my $args = process_options(
17     {
18         argv => [ q{--verbose} ],
19         mode => q{configure},
20     }
23 my $conf = Parrot::Configure->new;
25 my $pkg = q{auto::gc};
27 $conf->add_steps($pkg);
28 $conf->options->set( %{$args} );
30 my ( $task, $step_name, $step);
31 $task        = $conf->steps->[-1];
32 $step_name   = $task->step;
34 $step = $step_name->new();
35 ok( defined $step, "$step_name constructor returned defined value" );
36 isa_ok( $step, $step_name );
37 ok( $step->description(), "$step_name has description" );
40     my ($ret, $stdout);
41     capture(
42         sub { $ret = $step->runstep($conf); },
43         \$stdout,
44     );
45     ok( $ret, "$step_name runstep() returned true value" );
46     like( $stdout, qr/\(gc\)/, "Got expected verbose output");
47     is($conf->data->get('gc_flag'), q{},
48         "Got expected value for 'gc_flag'");
51 pass("Completed all tests in $0");
53 ################### DOCUMENTATION ###################
55 =head1 NAME
57 auto_gc-01.t - test config::auto::gc
59 =head1 SYNOPSIS
61     % prove t/steps/auto_gc-01.t
63 =head1 DESCRIPTION
65 The files in this directory test functionality used by F<Configure.pl>.
67 The tests in this file test subroutines exported by config::auto::gc.
69 =head1 AUTHOR
71 James E Keenan
73 =head1 SEE ALSO
75 config::auto::gc, F<Configure.pl>.
77 =cut
79 # Local Variables:
80 #   mode: cperl
81 #   cperl-indent-level: 4
82 #   fill-column: 100
83 # End:
84 # vim: expandtab shiftwidth=4: