2 # Copyright (C) 2007, Parrot Foundation.
8 use Test::More tests => 7;
12 use File::Temp qw(tempdir);
15 use_ok('config::init::headers');
16 use Parrot::Configure::Options qw( process_options );
17 use Parrot::Configure::Step::Test;
18 use Parrot::Configure::Test qw(
19 test_step_constructor_and_description
22 my ($args, $step_list_ref) = process_options(
29 my $conf = Parrot::Configure::Step::Test->new;
30 $conf->include_config_results( $args );
32 my $pkg = q{init::headers};
33 $conf->add_steps($pkg);
34 $conf->options->set( %{$args} );
36 my $step = test_step_constructor_and_description($conf);
40 my $tdir = tempdir( CLEANUP => 1 );
41 chdir $tdir or croak "Unable to change to tempdir for testing";
42 copy qq{$cwd/MANIFEST}, qq{$tdir/MANIFEST}
43 or croak "Unable to copy MANIFEST for testing";
45 tie @lines, 'Tie::File', qq{$tdir/MANIFEST}
46 or croak "Unable to tie to temporary MANIFEST";
47 push @lines, q{include/parrot/phony.h [main]include};
49 my $ret = $step->runstep($conf);
50 ok( defined $ret, "runstep() returned defined value" );
51 like( $conf->data->get(q{TEMP_nongen_headers}), qr{\$\(INC_DIR\)/phony\.h\\},
52 qq{Header added to MANIFEST for testing purposes correctly detected in Parrot::Configure object data structure}
55 unlink qq{$tdir/MANIFEST}
56 or croak "Unable to delete file after testing";
58 or croak "Unable to change back to starting directory after testing";
61 pass("Completed all tests in $0");
63 ################### DOCUMENTATION ###################
67 init/headers-01.t - test init::headers
71 % prove t/steps/init/headers-01.t
75 The files in this directory test functionality used by F<Configure.pl>.
77 The tests in this file test init::headers.
85 config::init::headers, F<Configure.pl>.
91 # cperl-indent-level: 4
94 # vim: expandtab shiftwidth=4: