Author: jkeenan
Date: Sun Jul 27 10:17:21 2008
New Revision: 29803
Modified:
branches/parallel/t/steps/auto_arch-01.t
branches/parallel/t/steps/auto_byteorder-01.t
branches/parallel/t/steps/auto_cpu-01.t
branches/parallel/t/steps/auto_format-01.t
branches/parallel/t/steps/auto_headers-01.t
branches/parallel/t/steps/auto_isreg-01.t
branches/parallel/t/steps/auto_jit-01.t
branches/parallel/t/steps/auto_sizes-01.t
branches/parallel/t/steps/auto_va_ptr-01.t
Log:
[configure] Fine-tuning of tests for configuration steps. Clarify POD.
Provide inline comments functioning as subheads where tests previously found
in multiple files have been moved into a single file. Use
Parrot::Configure::Test::test_step_constructor_and_description() to eliminate
repeated code. Delete outdated comments.
Modified: branches/parallel/t/steps/auto_arch-01.t
==============================================================================
--- branches/parallel/t/steps/auto_arch-01.t (original)
+++ branches/parallel/t/steps/auto_arch-01.t Sun Jul 27 10:17:21 2008
@@ -45,6 +45,8 @@
$conf->replenish($serialized);
+########## Darwin special case ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -79,6 +81,8 @@
$conf->replenish($serialized);
+########## verbose ##########
+
$args = process_options( {
argv => [ q{--verbose} ],
mode => q{configure},
@@ -103,6 +107,8 @@
$conf->replenish($serialized);
+########## mock architecture ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -123,6 +129,8 @@
$conf->replenish($serialized);
+########## mock darwin ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -145,6 +153,8 @@
$conf->replenish($serialized);
+########## mock darwin ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -167,6 +177,8 @@
$conf->replenish($serialized);
+########## mock win32 ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -187,6 +199,8 @@
$conf->replenish($serialized);
+########## mock win32 ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -207,6 +221,8 @@
$conf->replenish($serialized);
+########## mock cygwin ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -227,6 +243,8 @@
$conf->replenish($serialized);
+########## mock powerpc-linux ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -247,6 +265,8 @@
$conf->replenish($serialized);
+########## mock cygwin-i486 ##########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
Modified: branches/parallel/t/steps/auto_byteorder-01.t
==============================================================================
--- branches/parallel/t/steps/auto_byteorder-01.t (original)
+++ branches/parallel/t/steps/auto_byteorder-01.t Sun Jul 27 10:17:21 2008
@@ -5,14 +5,19 @@
use strict;
use warnings;
-use Test::More tests => 27;
+use Test::More tests => 29;
use Carp;
use lib qw( lib t/configure/testlib );
use_ok('config::init::defaults');
use_ok('config::auto::byteorder');
use Parrot::Configure;
use Parrot::Configure::Options qw( process_options );
-use Parrot::Configure::Test qw( test_step_thru_runstep);
+use Parrot::Configure::Test qw(
+ test_step_thru_runstep
+ test_step_constructor_and_description
+);
+
+########## _evaluate_byteorder() ##########
my $args = process_options(
{
@@ -32,15 +37,7 @@
my $serialized = $conf->pcfreeze();
$conf->options->set( %{$args} );
-
-my ( $task, $step_name, $step);
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$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 $step = test_step_constructor_and_description($conf);
my $byteorder = q{1234};
my $rv = $step->_evaluate_byteorder($conf, $byteorder);
@@ -51,6 +48,8 @@
$conf->replenish($serialized);
+########## _evaluate_byteorder() ##########
+
$args = process_options(
{
argv => [ ],
@@ -59,30 +58,26 @@
);
$conf->options->set( %{$args} );
-
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
+$step = test_step_constructor_and_description($conf);
$byteorder = q{8765};
$rv = $step->_evaluate_byteorder($conf, $byteorder);
ok( $rv, "_evaluate_byteorder() returned true value as expected");
is( $conf->data->get( 'byteorder'), $byteorder, "Got expected byteorder");
-ok( $conf->data->get( 'bigendian' ), "Not big-endian");
+ok( $conf->data->get( 'bigendian' ), "big-endian");
is( $step->result, 'big-endian', "Indeed, big-endian");
$byteorder = q{4321};
$rv = $step->_evaluate_byteorder($conf, $byteorder);
ok( $rv, "_evaluate_byteorder() returned true value as expected");
is( $conf->data->get( 'byteorder'), $byteorder, "Got expected byteorder");
-ok( $conf->data->get( 'bigendian' ), "Not big-endian");
+ok( $conf->data->get( 'bigendian' ), "big-endian");
is( $step->result, 'big-endian', "Indeed, big-endian");
$conf->replenish($serialized);
+########## _evaluate_byteorder(); phony byte order ##########
+
$args = process_options(
{
argv => [ ],
@@ -91,13 +86,7 @@
);
$conf->options->set( %{$args} );
-
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
+$step = test_step_constructor_and_description($conf);
$byteorder = q{foobar};
eval {
@@ -113,7 +102,7 @@
=head1 NAME
-auto_byteorder-01.t - test config::auto::byteorder
+auto_byteorder-01.t - test auto::byteorder
=head1 SYNOPSIS
@@ -123,7 +112,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::auto::byteorder.
+The tests in this file test auto::byteorder.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_cpu-01.t
==============================================================================
--- branches/parallel/t/steps/auto_cpu-01.t (original)
+++ branches/parallel/t/steps/auto_cpu-01.t Sun Jul 27 10:17:21 2008
@@ -19,6 +19,8 @@
);
use IO::CaptureOutput qw( capture );
+########### miniparrot ###########
+
my $args = process_options(
{
argv => [ q{--miniparrot} ],
@@ -43,6 +45,8 @@
$conf->replenish($serialized);
+########### verbose ###########
+
$args = process_options( {
argv => [ q{--verbose} ],
mode => q{configure},
@@ -68,6 +72,8 @@
$conf->replenish($serialized);
+########### mock cpuarch ###########
+
$args = process_options( {
argv => [ ],
mode => q{configure},
@@ -87,7 +93,7 @@
=head1 NAME
-auto_cpu-01.t - test config::auto::cpu
+auto_cpu-01.t - test auto::cpu
=head1 SYNOPSIS
@@ -97,8 +103,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test config::auto::cpu in the case where the
-C<--miniparrot> option has been provided to F<Configure.pl>.
+The tests in this file test auto::cpu.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_format-01.t
==============================================================================
--- branches/parallel/t/steps/auto_format-01.t (original)
+++ branches/parallel/t/steps/auto_format-01.t Sun Jul 27 10:17:21 2008
@@ -15,10 +15,11 @@
use Parrot::Configure::Options qw( process_options );
use Parrot::Configure::Test qw(
test_step_thru_runstep
- rerun_defaults_for_testing
test_step_constructor_and_description
);
+########## _set_intvalfmt() ##########
+
my $args = process_options( {
argv => [],
mode => q{configure},
@@ -82,6 +83,9 @@
qr/Can't find a printf-style format specifier for type '$type'/, #'
"Got expected error message");
}
+
+########## _set_floatvalfmt_nvsize() ##########
+
{
$conf->data->set( nv => 'double' );
auto::format::_set_floatvalfmt_nvsize($conf);
@@ -123,7 +127,7 @@
=head1 NAME
-auto_format-01.t - test config::auto::format
+auto_format-01.t - test auto::format
=head1 SYNOPSIS
@@ -133,7 +137,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::auto::format.
+The tests in this file test auto::format.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_headers-01.t
==============================================================================
--- branches/parallel/t/steps/auto_headers-01.t (original)
+++ branches/parallel/t/steps/auto_headers-01.t Sun Jul 27 10:17:21 2008
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 35;
+use Test::More tests => 38;
use Carp;
use lib qw( lib t/configure/testlib );
use_ok('config::init::defaults');
@@ -15,9 +15,12 @@
use Parrot::Configure::Test qw(
test_step_thru_runstep
rerun_defaults_for_testing
+ test_step_constructor_and_description
);
use IO::CaptureOutput qw | capture |;
+########## miniparrot ##########
+
my $args = process_options(
{
argv => [ q{--miniparrot} ],
@@ -34,22 +37,16 @@
$conf->add_steps($pkg);
$conf->options->set( %{$args} );
-
-my ( $task, $step_name, $step);
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$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 $step = test_step_constructor_and_description($conf);
my $ret = $step->runstep($conf);
-ok( $ret, "$step_name runstep() returned true value" );
+ok( $ret, "runstep() returned true value" );
is($step->result(), q{skipped}, "Expected result was set");
$conf->replenish($serialized);
+########## regular ##########
+
$args = process_options(
{
argv => [ ],
@@ -61,20 +58,16 @@
$conf->add_steps($pkg);
$conf->options->set( %{$args} );
-
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
+$step = test_step_constructor_and_description($conf);
$ret = $step->runstep($conf);
-ok( $ret, "$step_name runstep() returned true value" );
+ok( $ret, "runstep() returned true value" );
is($step->result(), q{}, "Result is empty string as expected");
$conf->replenish($serialized);
+########## verbose ##########
+
$args = process_options(
{
argv => [ q{--verbose} ],
@@ -86,25 +79,20 @@
$conf->add_steps($pkg);
$conf->options->set( %{$args} );
-
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
-
+$step = test_step_constructor_and_description($conf);
{
my $rv;
my $stdout;
capture ( sub {$rv = $step->runstep($conf) }, \$stdout);
ok( $stdout, "verbose output captured" );
- ok( $rv, "$step_name runstep() returned true value" );
+ ok( $rv, "runstep() returned true value" );
is($step->result(), q{}, "Result is empty string as expected");
}
$conf->replenish($serialized);
+########## _set_from_Config(); _list_extra_headers() ##########
+
$args = process_options(
{
argv => [ ],
@@ -116,13 +104,7 @@
$conf->add_steps($pkg);
$conf->options->set( %{$args} );
-
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
+$step = test_step_constructor_and_description($conf);
auto::headers::_set_from_Config($conf);
ok(! $conf->data->get('i_niin'), "Mapping made correctly");
@@ -141,7 +123,7 @@
=head1 NAME
-auto_headers-01.t - test config::auto::headers
+auto_headers-01.t - test auto::headers
=head1 SYNOPSIS
@@ -151,8 +133,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test config::auto::headers with the C<miniparrot>
-option set.
+The tests in this file test auto::headers.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_isreg-01.t
==============================================================================
--- branches/parallel/t/steps/auto_isreg-01.t (original)
+++ branches/parallel/t/steps/auto_isreg-01.t Sun Jul 27 10:17:21 2008
@@ -19,6 +19,8 @@
);
use IO::CaptureOutput qw| capture |;
+########## regular ##########
+
my $args = process_options( {
argv => [],
mode => q{configure},
@@ -40,6 +42,8 @@
$conf->replenish($serialized);
+########## _evaluate_isreg() ##########
+
$conf->options->set(%{$args});
$step = test_step_constructor_and_description($conf);
{
@@ -54,9 +58,10 @@
is($step->result, 'yes', "Got expected result");
}
-
$conf->replenish($serialized);
+########## _evaluate_isreg(); verbose ##########
+
$args = process_options( {
argv => [ q{--verbose} ],
mode => q{configure},
@@ -81,7 +86,7 @@
=head1 NAME
-auto_isreg-01.t - test config::auto::isreg
+auto_isreg-01.t - test auto::isreg
=head1 SYNOPSIS
@@ -91,7 +96,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::auto::isreg.
+The tests in this file test auto::isreg.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_jit-01.t
==============================================================================
--- branches/parallel/t/steps/auto_jit-01.t (original)
+++ branches/parallel/t/steps/auto_jit-01.t Sun Jul 27 10:17:21 2008
@@ -360,7 +360,7 @@
=head1 NAME
-auto_jit-01.t - test config::auto::jit
+auto_jit-01.t - test auto::jit
=head1 SYNOPSIS
@@ -370,8 +370,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file tests config::auto::jit with the C<--miniparrot>
-option.
+The tests in this file test auto::jit.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_sizes-01.t
==============================================================================
--- branches/parallel/t/steps/auto_sizes-01.t (original)
+++ branches/parallel/t/steps/auto_sizes-01.t Sun Jul 27 10:17:21 2008
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 49;
+use Test::More tests => 50;
use Carp;
use lib qw( lib t/configure/testlib );
use_ok('config::init::defaults');
@@ -15,9 +15,12 @@
use Parrot::Configure::Test qw(
test_step_thru_runstep
rerun_defaults_for_testing
+ test_step_constructor_and_description
);
use IO::CaptureOutput qw | capture |;
+########## miniparrot ##########
+
my $args = process_options(
{
argv => [ q{--miniparrot} ],
@@ -35,22 +38,16 @@
$conf->add_steps($pkg);
$conf->options->set( %{$args} );
-
-my ( $task, $step_name, $step);
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$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 $step = test_step_constructor_and_description($conf);
my $ret = $step->runstep($conf);
-ok( $ret, "$step_name runstep() returned true value" );
+ok( $ret, "runstep() returned true value" );
is($step->result(), q{using miniparrot defaults}, "Expected result was set");
$conf->replenish($serialized);
+########## _handle_intval_ptrsize_discrepancy() ##########
+
$args = process_options(
{
argv => [ ],
@@ -64,15 +61,7 @@
$conf->add_steps($pkg);
$conf->options->set( %{$args} );
-
-$task = $conf->steps->[-1];
-$step_name = $task->step;
-
-$step = $step_name->new();
-ok( defined $step, "$step_name constructor returned defined value" );
-isa_ok( $step, $step_name );
-
-
+$step = test_step_constructor_and_description($conf);
{
my $stdout;
my %results = (
@@ -101,6 +90,8 @@
);
}
+########## _set_int2() ##########
+
{
my $stdout;
my %results = ( shortsize => 2 );
@@ -126,6 +117,8 @@
"Got expected warning");
}
+########## _set_int4() ##########
+
{
my $stdout;
my %results = ( shortsize => 4 );
@@ -175,6 +168,8 @@
"Got expected warning");
}
+########## _set_float4() ##########
+
{
my $stdout;
my %results = ( floatsize => 4 );
@@ -200,6 +195,8 @@
"Got expected warning");
}
+########## _set_float8() ##########
+
{
my $stdout;
my %results = ( doublesize => 8 );
@@ -225,6 +222,8 @@
"Got expected warning");
}
+########## _handle_hugeintvalsize() ##########
+
my (%hugeintval, $intval, $intvalsize);
$conf->data->set( intval => undef );
@@ -290,6 +289,8 @@
$conf->data->set( intval => undef );
$conf->data->set( intvalsize => undef );
+########## _set_hugefloatval() ##########
+
my $size = 12;
auto::sizes::_set_hugefloatval( $conf, $size );
is( $conf->data->get( 'hugefloatval' ), 'long double',
@@ -309,7 +310,7 @@
=head1 NAME
-auto_sizes-01.t - test config::auto::sizes
+auto_sizes-01.t - test auto::sizes
=head1 SYNOPSIS
@@ -319,7 +320,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::auto::sizes.
+The tests in this file test auto::sizes.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_va_ptr-01.t
==============================================================================
--- branches/parallel/t/steps/auto_va_ptr-01.t (original)
+++ branches/parallel/t/steps/auto_va_ptr-01.t Sun Jul 27 10:17:21 2008
@@ -5,18 +5,33 @@
use strict;
use warnings;
-use Test::More tests => 2;
+use Test::More tests => 10;
use Carp;
-use lib qw( lib );
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
use_ok('config::auto::va_ptr');
-
-=for hints_for_testing The documentation of the package being tested is
-insufficient; please try to improve it. Explore the likelihood of seg
-faults while running the test. Check latest reports of Parrot
-configuration tools testing coverage to see where your time available
-for writing tests is spent.
-
-=cut
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Test qw(
+ test_step_thru_runstep
+ test_step_constructor_and_description
+);
+
+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::va_ptr};
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+my $step = test_step_constructor_and_description($conf);
pass("Completed all tests in $0");
@@ -24,7 +39,7 @@
=head1 NAME
-auto_va_ptr-01.t - test config::auto::va_ptr
+auto_va_ptr-01.t - test auto::va_ptr
=head1 SYNOPSIS
@@ -34,7 +49,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::auto::va_ptr.
+The tests in this file test auto::va_ptr.
=head1 AUTHOR