Patch attached supplies slight refactoring of configuration step class auto::alignptrs and 5 test files. Will apply in 2-3 days if there is no objection. Thank you very much.
kid51
Index: MANIFEST =================================================================== --- MANIFEST (revision 22667) +++ MANIFEST (working copy) @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Thu Nov 1 01:49:58 2007 UT +# generated by tools/dev/mk_manifest_and_skip.pl Sat Nov 3 03:18:13 2007 UT # # See tools/dev/install_files.pl for documentation on the # format of this file. @@ -3059,6 +3059,10 @@ t/configure/122-auto_ops.t [] t/configure/123-auto_pmc.t [] t/configure/124-auto_alignptrs-01.t [] +t/configure/124-auto_alignptrs-02.t [] +t/configure/124-auto_alignptrs-03.t [] +t/configure/124-auto_alignptrs-04.t [] +t/configure/124-auto_alignptrs-05.t [] t/configure/125-auto_headers-01.t [] t/configure/126-auto_sizes-01.t [] t/configure/127-auto_byteorder-01.t [] Index: t/configure/124-auto_alignptrs-02.t =================================================================== --- t/configure/124-auto_alignptrs-02.t (revision 0) +++ t/configure/124-auto_alignptrs-02.t (revision 0) @@ -0,0 +1,82 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 124-auto_alignptrs-02.t + +use strict; +use warnings; +use Test::More tests => 12; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::alignptrs'); +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::alignptrs}; + +$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 $align = 1; +$conf->data->set('ptr_alignment' => $align); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), qq{configured: $align byte}, "Expected result was set"); + +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +124-auto_alignptrs-02.t - test config::auto::alignptrs + +=head1 SYNOPSIS + + % prove t/configure/124-auto_alignptrs-02.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test subroutines exported by config::auto::alignptrs. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::alignptrs, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Property changes on: t/configure/124-auto_alignptrs-02.t ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Index: t/configure/124-auto_alignptrs-03.t =================================================================== --- t/configure/124-auto_alignptrs-03.t (revision 0) +++ t/configure/124-auto_alignptrs-03.t (revision 0) @@ -0,0 +1,82 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 124-auto_alignptrs-03.t + +use strict; +use warnings; +use Test::More tests => 12; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::alignptrs'); +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::alignptrs}; + +$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 $align = 2; +$conf->data->set('ptr_alignment' => $align); +my $ret = $step->runstep($conf); +ok( $ret, "$step_name runstep() returned true value" ); +is($step->result(), qq{configured: $align bytes}, "Expected result was set"); + +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +124-auto_alignptrs-03.t - test config::auto::alignptrs + +=head1 SYNOPSIS + + % prove t/configure/124-auto_alignptrs-03.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test subroutines exported by config::auto::alignptrs. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::alignptrs, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Property changes on: t/configure/124-auto_alignptrs-03.t ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Index: t/configure/124-auto_alignptrs-04.t =================================================================== --- t/configure/124-auto_alignptrs-04.t (revision 0) +++ t/configure/124-auto_alignptrs-04.t (revision 0) @@ -0,0 +1,92 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 124-auto_alignptrs-04.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::alignptrs'); +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::alignptrs}; + +$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" ); + +{ + use Config; + local $^O = q{hpux}; + my $ret = $step->runstep($conf); + ok( $ret, "$step_name runstep() returned true value" ); + if ( $Config{ccflags} !~ /DD64/ ) { + is($conf->data->get('ptr_alignment'), 4, + "Got expected pointer alignment for HP Unix"); + is($step->result(), qq{for hpux: 4 bytes}, + "Expected result was set"); + } else { + pass("Cannot mock %Config"); + pass("Cannot mock %Config"); + } +} + +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +124-auto_alignptrs-04.t - test config::auto::alignptrs + +=head1 SYNOPSIS + + % prove t/configure/124-auto_alignptrs-04.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test subroutines exported by config::auto::alignptrs. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::alignptrs, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Property changes on: t/configure/124-auto_alignptrs-04.t ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Index: t/configure/124-auto_alignptrs-05.t =================================================================== --- t/configure/124-auto_alignptrs-05.t (revision 0) +++ t/configure/124-auto_alignptrs-05.t (revision 0) @@ -0,0 +1,90 @@ +#! perl +# Copyright (C) 2007, The Perl Foundation. +# $Id$ +# 124-auto_alignptrs-05.t + +use strict; +use warnings; +use Test::More qw(no_plan); # tests => 13; +use Carp; +use lib qw( lib t/configure/testlib ); +use_ok('config::init::defaults'); +use_ok('config::auto::alignptrs'); +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::alignptrs}; + +$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" ); + +{ + $conf->data->set('ptr_alignment' => undef); + if ($^O eq q{hpux}) { $^O = q{linux} } + my $ret; + eval { $ret = $step->runstep($conf); }; + if ($@) { + like($@, qr/Can't determine alignment/, + "Got expected error message when runstep() failed"); + } else { + like($step->result(), qr/bytes?/, + "Expected result was set"); + } +} + +pass("Completed all tests in $0"); + +################### DOCUMENTATION ################### + +=head1 NAME + +124-auto_alignptrs-05.t - test config::auto::alignptrs + +=head1 SYNOPSIS + + % prove t/configure/124-auto_alignptrs-05.t + +=head1 DESCRIPTION + +The files in this directory test functionality used by F<Configure.pl>. + +The tests in this file test subroutines exported by config::auto::alignptrs. + +=head1 AUTHOR + +James E Keenan + +=head1 SEE ALSO + +config::auto::alignptrs, F<Configure.pl>. + +=cut + +# Local Variables: +# mode: cperl +# cperl-indent-level: 4 +# fill-column: 100 +# End: +# vim: expandtab shiftwidth=4: Property changes on: t/configure/124-auto_alignptrs-05.t ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Index: config/auto/alignptrs.pm =================================================================== --- config/auto/alignptrs.pm (revision 22667) +++ config/auto/alignptrs.pm (working copy) @@ -39,18 +39,18 @@ return 1; } - $self->set_result(''); + my $result_str = ''; my $align; if ( defined( $conf->data->get('ptr_alignment') ) ) { $align = $conf->data->get('ptr_alignment'); - $self->set_result("configured: "); + $result_str .= "configured: "; } elsif ( $^O eq 'hpux' && $Config{ccflags} !~ /DD64/ ) { # HP-UX 10.20/32 hangs in this test. $align = 4; $conf->data->set( ptr_alignment => $align ); - $self->set_result("for hpux: "); + $result_str .= "for hpux: "; } else { @@ -69,8 +69,9 @@ $conf->data->set( ptr_alignment => $align ); } - $self->set_result( $self->result . " $align byte" ); - $self->set_result( $self->result . 's' ) unless $align == 1; + $result_str .= " $align byte"; + $result_str .= "s" unless $align == 1; + $self->set_result($result_str); return 1; }