tagged release 0.6.4
[parrot.git] / t / steps / auto_arch-06.t
blob1fa2a4518c2cafbf73595a8a70a157f6be9cd5ba
1 #! perl
2 # Copyright (C) 2007, The Perl Foundation.
3 # $Id$
4 # auto_arch-06.t
6 use strict;
7 use warnings;
8 use Test::More tests =>  13;
9 use Carp;
10 use lib qw( lib t/configure/testlib );
11 use_ok('config::init::defaults');
12 use_ok('config::auto::arch');
13 use Parrot::Configure;
14 use Parrot::Configure::Options qw( process_options );
15 use Parrot::Configure::Test qw( test_step_thru_runstep);
17 my $args = process_options(
18     {
19         argv => [ ],
20         mode => q{configure},
21     }
24 my $conf = Parrot::Configure->new;
26 test_step_thru_runstep( $conf, q{init::defaults}, $args );
28 my $pkg = q{auto::arch};
30 $conf->add_steps($pkg);
31 $conf->options->set( %{$args} );
33 my ( $task, $step_name, $step);
34 $task        = $conf->steps->[-1];
35 $step_name   = $task->step;
37 $step = $step_name->new();
38 ok( defined $step, "$step_name constructor returned defined value" );
39 isa_ok( $step, $step_name );
42 my $pseudoarch = q{darwin-thread-multi-2level};
43 $conf->data->set('archname' => $pseudoarch);
44 my $pseudobyteorder = 4321;
45 $conf->data->set('byteorder' => $pseudobyteorder);
46 my $ret = $step->runstep($conf);
47 ok( $ret, "$step_name runstep() returned true value" );
48 is($step->result(), q{}, "Result was empty string as expected");
49 is($conf->data->get('cpuarch'), q{ppc},
50     "'cpuarch' was set as expected");
51 is($conf->data->get('osname'), q{darwin},
52     "'osname' was set as expected");
55 pass("Completed all tests in $0");
57 ################### DOCUMENTATION ###################
59 =head1 NAME
61 auto_arch-06.t - test config::auto::arch
63 =head1 SYNOPSIS
65     % prove t/steps/auto_arch-06.t
67 =head1 DESCRIPTION
69 The files in this directory test functionality used by F<Configure.pl>.
71 The tests in this file test config::auto::arch in the case where
72 your OS is Darwin and you are using the vendor-supplied Perl and
73 byteorder is other than C<1234>.
75 =head1 AUTHOR
77 James E Keenan
79 =head1 SEE ALSO
81 config::auto::arch, F<Configure.pl>.
83 =cut
85 # Local Variables:
86 #   mode: cperl
87 #   cperl-indent-level: 4
88 #   fill-column: 100
89 # End:
90 # vim: expandtab shiftwidth=4: