Author: jkeenan Date: Thu Nov 15 05:14:30 2007 New Revision: 22835 Added: branches/archjit/config/auto/arch.pm (contents, props changed) branches/archjit/t/configure/132-auto_arch-01.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-02.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-03.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-04.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-05.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-06.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-07.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-08.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-09.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-10.t (contents, props changed) branches/archjit/t/configure/132-auto_arch-11.t (contents, props changed) branches/archjit/t/configure/132-auto_jit-02.t (contents, props changed) branches/archjit/t/configure/132-auto_jit-03.t (contents, props changed) Modified: branches/archjit/MANIFEST branches/archjit/config/auto/jit.pm branches/archjit/lib/Parrot/Configure/Step/List.pm branches/archjit/t/configure/132-auto_jit-01.t
Log: 'archjit' branch created to handle refactoring/testing of config/auto/jit.pm into two separate config step classes: auto::arch and auto::jit. Modified: branches/archjit/MANIFEST ============================================================================== --- branches/archjit/MANIFEST (original) +++ branches/archjit/MANIFEST Thu Nov 15 05:14:30 2007 @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Wed Nov 14 03:59:48 2007 UT +# generated by tools/dev/mk_manifest_and_skip.pl Thu Nov 15 13:13:16 2007 UT # # See tools/dev/install_files.pl for documentation on the # format of this file. @@ -171,6 +171,7 @@ config/auto/aio/aio.in [] config/auto/alignptrs.pm [] config/auto/alignptrs/test_c.in [] +config/auto/arch.pm [] config/auto/attributes.pm [] config/auto/attributes/test_c.in [] config/auto/backtrace.pm [] @@ -3083,7 +3084,20 @@ t/configure/131-auto_isreg-01.t [] t/configure/131-auto_isreg-02.t [] t/configure/131-auto_isreg-03.t [] +t/configure/132-auto_arch-01.t [] +t/configure/132-auto_arch-02.t [] +t/configure/132-auto_arch-03.t [] +t/configure/132-auto_arch-04.t [] +t/configure/132-auto_arch-05.t [] +t/configure/132-auto_arch-06.t [] +t/configure/132-auto_arch-07.t [] +t/configure/132-auto_arch-08.t [] +t/configure/132-auto_arch-09.t [] +t/configure/132-auto_arch-10.t [] +t/configure/132-auto_arch-11.t [] t/configure/132-auto_jit-01.t [] +t/configure/132-auto_jit-02.t [] +t/configure/132-auto_jit-03.t [] t/configure/133-gen_cpu.t [] t/configure/134-auto_funcptr.t [] t/configure/135-auto_cgoto-01.t [] Added: branches/archjit/config/auto/arch.pm ============================================================================== --- (empty file) +++ branches/archjit/config/auto/arch.pm Thu Nov 15 05:14:30 2007 @@ -0,0 +1,106 @@ +# Copyright (C) 2001-2007, The Perl Foundation. +# $Id$ + +=head1 NAME + +config/auto/arch - Determine CPU architecture and operating system + +=head1 DESCRIPTION + +Determines the CPU architecture, the operating system. + +=cut + +package auto::arch; + +use strict; +use warnings; + + +use base qw(Parrot::Configure::Step::Base); + +use Parrot::Configure::Step; + +sub _init { + my $self = shift; + my %data; + $data{description} = q{Determining CPU architecture and OS}; + $data{args} = [ ]; + $data{result} = q{}; + return \%data; +} + +sub runstep { + my ( $self, $conf ) = @_; + + if ( $conf->options->get('miniparrot') ) { + $self->set_result('skipped'); + return 1; + } + + my $verbose = $conf->options->get('verbose'); + $verbose and print "\n"; + + my $archname = $conf->data->get('archname'); + my ( $cpuarch, $osname ) = split( /-/, $archname ); + + if ($verbose) { + print "determining operating system and cpu architecture\n"; + print "archname: <$archname>\n"; + } + + if ( !defined $osname ) { + ( $osname, $cpuarch ) = ( $cpuarch, q{} ); + } + + # This was added to convert 9000/800 to 9000_800 on HP-UX + $cpuarch =~ s|/|_|g; + + # On OS X if you are using the Perl that shipped with the system + # the above split fails because archname is "darwin-thread-multi-2level". + if ( $cpuarch =~ /darwin/ ) { + $osname = 'darwin'; + if ( $conf->data->get('byteorder') == 1234 ) { + $cpuarch = 'i386'; + } + else { + $cpuarch = 'ppc'; + } + } + + # cpuarch and osname are reversed in archname on windows + elsif ( $cpuarch =~ /MSWin32/ ) { + $cpuarch = ( $osname =~ /x64/ ) ? 'amd64' : 'i386'; + $osname = 'MSWin32'; + } + elsif ( $osname =~ /cygwin/i || $cpuarch =~ /cygwin/i ) { + $cpuarch = 'i386'; + $osname = 'cygwin'; + } + + if ( $archname =~ m/powerpc/ ) { + $cpuarch = 'ppc'; + } + + $cpuarch =~ s/armv[34]l?/arm/i; + $cpuarch =~ s/i[456]86/i386/i; + $cpuarch =~ s/x86_64/amd64/i; + + print "osname: $osname\ncpuarch: $cpuarch\n" if $verbose; + + $conf->data->set( + cpuarch => $cpuarch, + osname => $osname + ); + + return 1; +} + +1; + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Modified: branches/archjit/config/auto/jit.pm ============================================================================== --- branches/archjit/config/auto/jit.pm (original) +++ branches/archjit/config/auto/jit.pm Thu Nov 15 05:14:30 2007 @@ -7,10 +7,10 @@ =head1 DESCRIPTION -Determines the CPU architecture, the operating system, and whether there is JIT -capability available. Use the C<--jitcapable> and C<--execcapable> options to -override the default value calculated specifically for your CPU architecture -and operating system. +Determines whether there is JIT capability available. Use the +C<--jitcapable> and C<--execcapable> options to override the default +value calculated specifically for your CPU architecture and operating +system. =cut @@ -44,68 +44,20 @@ my $verbose = $conf->options->get('verbose'); $verbose and print "\n"; - my $jitbase = 'src/jit'; # base path for jit sources my $archname = $conf->data->get('archname'); - my ( $cpuarch, $osname ) = split( /-/, $archname ); - - if ($verbose) { - print "determining operating system and cpu architecture\n"; - print "archname: <$archname>\n"; - } - - if ( !defined $osname ) { - ( $osname, $cpuarch ) = ( $cpuarch, q{} ); - } - - # This was added to convert 9000/800 to 9000_800 on HP-UX - $cpuarch =~ s|/|_|g; - - # On OS X if you are using the Perl that shipped with the system - # the above split fails because archname is "darwin-thread-multi-2level". - if ( $cpuarch =~ /darwin/ ) { - $osname = 'darwin'; - if ( $conf->data->get('byteorder') == 1234 ) { - $cpuarch = 'i386'; - } - else { - $cpuarch = 'ppc'; - } - } - - # cpuarch and osname are reversed in archname on windows - elsif ( $cpuarch =~ /MSWin32/ ) { - $cpuarch = ( $osname =~ /x64/ ) ? 'amd64' : 'i386'; - $osname = 'MSWin32'; - } - elsif ( $osname =~ /cygwin/i || $cpuarch =~ /cygwin/i ) { - $cpuarch = 'i386'; - $osname = 'cygwin'; - } - - if ( $archname =~ m/powerpc/ ) { - $cpuarch = 'ppc'; - } - - $cpuarch =~ s/armv[34]l?/arm/i; - $cpuarch =~ s/i[456]86/i386/i; - $cpuarch =~ s/x86_64/amd64/i; - - warn "osname: $osname\ncpuarch: $cpuarch\n" if $verbose; - - $conf->data->set( - archname => $archname, - cpuarch => $cpuarch, - osname => $osname - ); + my $cpuarch = $conf->data->get('cpuarch'); + my $osname = $conf->data->get('osname'); + my $jitbase = 'src/jit'; # base path for jit sources my $jitarchname = "$cpuarch-$osname"; my ( $jitcapable, $execcapable ) = ( 0, 0 ); - print( qq{-e "$jitbase/$cpuarch/core.jit" = }, - -e "$jitbase/$cpuarch/core.jit" ? 'yes' : 'no', "\n" ) + my $corejit = "$jitbase/$cpuarch/core.jit"; + print( qq{-e $corejit = }, + -e $corejit ? 'yes' : 'no', "\n" ) if $verbose; - if ( -e "$jitbase/$cpuarch/core.jit" ) { + if ( -e $corejit ) { # Just because there is a "$jitbase/$cpuarch/core.jit" file, # doesn't mean the JIT is working on that platform. @@ -127,12 +79,14 @@ } } - if ( -e "$jitbase/$cpuarch/$jitarchname.s" ) { - copy_if_diff( "$jitbase/$cpuarch/$jitarchname.s", "src/asmfun.s" ); + my $sjit = "$jitbase/$cpuarch/$jitarchname.s"; + my $asm = "$jitbase/$cpuarch/asm.s"; + if ( -e $sjit ) { + copy_if_diff( $sjit, "src/asmfun.s" ); $conf->data->set( asmfun_o => 'src/asmfun$(O)' ); } - elsif ( -e "$jitbase/$cpuarch/asm.s" ) { - copy_if_diff( "$jitbase/$cpuarch/asm.s", "src/asmfun.s" ); + elsif ( -e $asm ) { + copy_if_diff( $asm, "src/asmfun.s" ); $conf->data->set( asmfun_o => 'src/asmfun$(O)' ); } else { Modified: branches/archjit/lib/Parrot/Configure/Step/List.pm ============================================================================== --- branches/archjit/lib/Parrot/Configure/Step/List.pm (original) +++ branches/archjit/lib/Parrot/Configure/Step/List.pm Thu Nov 15 05:14:30 2007 @@ -38,6 +38,7 @@ auto::pack auto::format auto::isreg + auto::arch auto::jit gen::cpu auto::funcptr Added: branches/archjit/t/configure/132-auto_arch-01.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-01.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,82 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-01.t + +use strict; +use warnings; +use Test::More tests => 13; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ q{--miniparrot} ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{skipped}, "Got expected result"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-01.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-01.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch when the C<--miniparrot> +option is provided. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-02.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-02.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,81 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-02.t + +use strict; +use warnings; +use Test::More tests => 13; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-02.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-02.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in its typical case. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-03.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-03.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,89 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-03.t + +use strict; +use warnings; +use Test::More tests => 14; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); +use Parrot::IO::Capture::Mini; + +my $args = process_options( + { + argv => [ q{--verbose} ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +{ + my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini" + or croak "Unable to tie"; + my $ret = $step->runstep($conf); + my @more_lines = $tie_out->READLINE; + ok( @more_lines, "verbose output captured" ); + ok( $ret, "$step_name runstep() returned true value" ); + is($step->result(), q{}, "Result was empty string as expected"); +} +untie *STDOUT; + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-03.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-03.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in C<--verbose> mode. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-04.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-04.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,88 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-04.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{foobar}; +$conf->data->set('archname' => $pseudoarch); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), $pseudoarch, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-04.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-04.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +C<archname> is not hyphenated. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-05.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-05.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,91 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-05.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{darwin-thread-multi-2level}; +$conf->data->set('archname' => $pseudoarch); +my $pseudobyteorder = 1234; +$conf->data->set('byteorder' => $pseudobyteorder); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{i386}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), q{darwin}, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-05.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-05.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +your OS is Darwin and you are using the vendor-supplied Perl and +byteorder is C<1234>. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-06.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-06.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,91 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-06.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{darwin-thread-multi-2level}; +$conf->data->set('archname' => $pseudoarch); +my $pseudobyteorder = 4321; +$conf->data->set('byteorder' => $pseudobyteorder); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{ppc}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), q{darwin}, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-06.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-06.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +your OS is Darwin and you are using the vendor-supplied Perl and +byteorder is other than C<1234>. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-07.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-07.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,88 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-07.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{MSWin32-x64}; +$conf->data->set('archname' => $pseudoarch); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{amd64}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), q{MSWin32}, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-07.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-07.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +your OS is MSWin32 and your architecture is something matching C<x64>. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-08.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-08.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,88 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-08.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{MSWin32-i386}; +$conf->data->set('archname' => $pseudoarch); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{i386}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), q{MSWin32}, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-08.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-08.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +your OS is MSWin32 and your architecture is something not matching C<x64>. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-09.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-09.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,88 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-09.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{cygwin}; +$conf->data->set('archname' => $pseudoarch); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{i386}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), q{cygwin}, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-09.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-09.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +your OS is Cygwin. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-10.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-10.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,88 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-10.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{powerpc-linux}; +$conf->data->set('archname' => $pseudoarch); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{ppc}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), q{linux}, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-10.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-10.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +your architecture is something like 'linux-powerpc'. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_arch-11.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_arch-11.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,88 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_arch-11.t + +use strict; +use warnings; +use Test::More tests => 15; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); + +my $pkg = q{auto::arch}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[1]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $pseudoarch = q{cygwin-i486}; +$conf->data->set('archname' => $pseudoarch); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +is($conf->data->get('cpuarch'), q{i386}, + "'cpuarch' was set as expected"); +is($conf->data->get('osname'), q{cygwin}, + "'osname' was set as expected"); + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_arch-11.t - test config::auto::arch + +=head1 SYNOPSIS + + % prove t/configure/132-auto_arch-11.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test config::auto::arch in the case where +the architecture name is something like 'cygwin-i486'. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::arch, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Modified: branches/archjit/t/configure/132-auto_jit-01.t ============================================================================== --- branches/archjit/t/configure/132-auto_jit-01.t (original) +++ branches/archjit/t/configure/132-auto_jit-01.t Thu Nov 15 05:14:30 2007 @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 13; use Carp; use lib qw( lib t/configure/testlib ); use_ok('config::init::defaults'); @@ -52,7 +52,7 @@ ok( $ret, "$step_name runstep() returned true value" ); is($step->result(), q{skipped}, "Expected result was set"); - +pass("Keep Devel::Cover happy"); pass("Completed all tests in $0"); ################### DOCUMENTATION ################### @@ -69,7 +69,8 @@ The files in this directory test functionality used by F<Configure.pl>. -The tests in this file test subroutines exported by config::auto::jit. +The tests in this file tests config::auto::jit with the C<--miniparrot> +option. =head1 AUTHOR Added: branches/archjit/t/configure/132-auto_jit-02.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_jit-02.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,86 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_jit-02.t + +use strict; +use warnings; +use Test::More tests => 18; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use_ok('config::auto::jit'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); + +my $args = process_options( + { + argv => [ ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); +test_step_thru_runstep( $conf, q{auto::arch}, $args ); + +my $pkg = q{auto::jit}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[2]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), q{}, "Result was empty string as expected"); +#print STDERR "archname: ", $conf->data->get('archname'), "\n"; +#print STDERR "cpuarch: ", $conf->data->get('cpuarch'), "\n"; +#print STDERR "osname: ", $conf->data->get('osname'), "\n"; + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_jit-02.t - test config::auto::jit + +=head1 SYNOPSIS + + % prove t/configure/132-auto_jit-02.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file tests config::auto::jit in its most typical use. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::jit, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Added: branches/archjit/t/configure/132-auto_jit-03.t ============================================================================== --- (empty file) +++ branches/archjit/t/configure/132-auto_jit-03.t Thu Nov 15 05:14:30 2007 @@ -0,0 +1,96 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 132-auto_jit-03.t + +use strict; +use warnings; +use Test::More tests => 19; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::arch'); +use_ok('config::auto::jit'); +use Parrot::Configure; +use Parrot::Configure::Options qw( process_options ); +use Parrot::Configure::Test qw( test_step_thru_runstep); +use Parrot::IO::Capture::Mini; + +my $args = process_options( + { + argv => [ q{--verbose} ], + mode => q{configure}, + } +); + +my $conf = Parrot::Configure->new; + +test_step_thru_runstep( $conf, q{init::defaults}, $args ); +{ + my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini" + or croak "Unable to tie"; + test_step_thru_runstep( $conf, q{auto::arch}, $args ); +} +untie *STDOUT; + +my $pkg = q{auto::jit}; + +$conf->add_steps($pkg); +$conf->options->set( %{$args} ); + +my ( $task, $step_name, @step_params, $step); +$task = $conf->steps->[2]; +$step_name = $task->step; [EMAIL PROTECTED] = @{ $task->params }; + +$step = $step_name->new(); +ok( defined $step, "$step_name constructor returned defined value" ); +isa_ok( $step, $step_name ); +ok( $step->description(), "$step_name has description" ); + +{ + my $tie_out = tie *STDOUT, "Parrot::IO::Capture::Mini" + or croak "Unable to tie"; + my $ret = $step->runstep($conf); + my @more_lines = $tie_out->READLINE; + ok( @more_lines, "verbose output captured" ); + ok( $ret, "$step_name runstep() returned true value" ); + is($step->result(), q{}, "Result was empty string as expected"); +} +untie *STDOUT; + +pass("Keep Devel::Cover happy"); +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +132-auto_jit-03.t - test config::auto::jit + +=head1 SYNOPSIS + + % prove t/configure/132-auto_jit-03.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file tests config::auto::jit in C<--verbose> mode. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::jit, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: