Author: jkeenan
Date: Sun Jul 27 09:26:09 2008
New Revision: 29802
Modified:
branches/parallel/t/steps/auto_alignptrs-01.t
branches/parallel/t/steps/auto_alignptrs-02.t
branches/parallel/t/steps/auto_attributes-01.t
branches/parallel/t/steps/auto_ops-01.t
branches/parallel/t/steps/auto_pmc-01.t
branches/parallel/t/steps/auto_warnings-01.t
branches/parallel/t/steps/init_optimize-01.t
branches/parallel/t/steps/inter_charset-01.t
branches/parallel/t/steps/inter_encoding-01.t
branches/parallel/t/steps/inter_libparrot-01.t
branches/parallel/t/steps/inter_shlibs-01.t
branches/parallel/t/steps/inter_types-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_alignptrs-01.t
==============================================================================
--- branches/parallel/t/steps/auto_alignptrs-01.t (original)
+++ branches/parallel/t/steps/auto_alignptrs-01.t Sun Jul 27 09:26:09 2008
@@ -5,15 +5,19 @@
use strict;
use warnings;
-use Test::More tests => 20;
+use Test::More tests => 22;
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);
-use Data::Dumper;
+use Parrot::Configure::Test qw(
+ test_step_thru_runstep
+ test_step_constructor_and_description
+);
+
+########## miniparrot ##########
my $args = process_options(
{
@@ -32,22 +36,16 @@
my $pkg = q{auto::alignptrs};
$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; singular ##########
+
$args = process_options(
{
argv => [ ],
@@ -57,21 +55,17 @@
$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 $align = 1;
$conf->data->set('ptr_alignment' => $align);
$ret = $step->runstep($conf);
-ok( $ret, "$step_name runstep() returned true value" );
+ok( $ret, "runstep() returned true value" );
is($step->result(), qq{configured: $align byte}, "Expected result was set");
$conf->replenish($serialized);
+########## regular; plural ##########
+
$args = process_options(
{
argv => [ ],
@@ -81,18 +75,11 @@
$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);
$align = 2;
$conf->data->set('ptr_alignment' => $align);
$ret = $step->runstep($conf);
-ok( $ret, "$step_name runstep() returned true value" );
+ok( $ret, "runstep() returned true value" );
is($step->result(), qq{configured: $align bytes}, "Expected result was set");
pass("Completed all tests in $0");
Modified: branches/parallel/t/steps/auto_alignptrs-02.t
==============================================================================
--- branches/parallel/t/steps/auto_alignptrs-02.t (original)
+++ branches/parallel/t/steps/auto_alignptrs-02.t Sun Jul 27 09:26:09 2008
@@ -5,14 +5,19 @@
use strict;
use warnings;
-use Test::More tests => 17;
+use Test::More tests => 18;
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);
+use Parrot::Configure::Test qw(
+ test_step_thru_runstep
+ test_step_constructor_and_description
+);
+
+########## mock hpux ##########
my $args = process_options(
{
@@ -29,21 +34,14 @@
$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 );
+my $step = test_step_constructor_and_description($conf);
my $serialized = $conf->pcfreeze();
{
$conf->data->set_p5( OSNAME => 'hpux' );
my $ret = $step->runstep($conf);
- ok( $ret, "$step_name runstep() returned true value" );
+ ok( $ret, "runstep() returned true value" );
if ( $conf->data->get_p5('ccflags') !~ /DD64/ ) {
is($conf->data->get('ptr_alignment'), 4,
"Got expected pointer alignment for HP Unix");
@@ -57,6 +55,8 @@
$conf->replenish($serialized);
+########## _evaluate_ptr_alignment() ##########
+
my $align = 2;
auto::alignptrs::_evaluate_ptr_alignment($conf, $align);
is($conf->data->get( 'ptr_alignment' ), 2,
@@ -64,13 +64,17 @@
$conf->replenish($serialized);
+########## _evaluate_ptr_alignment() ##########
+
$align = undef;
eval { auto::alignptrs::_evaluate_ptr_alignment($conf, $align); };
-like($@, qr/Can't determine alignment!/,
+like($@, qr/Can't determine alignment!/, #'
"Got expected 'die' message");
$conf->replenish($serialized);
+########## _evaluate_results() ##########
+
my ($results, $try_align);
is(auto::alignptrs::_evaluate_results(q{OK}, 2), 2,
"Got expected alignment");
Modified: branches/parallel/t/steps/auto_attributes-01.t
==============================================================================
--- branches/parallel/t/steps/auto_attributes-01.t (original)
+++ branches/parallel/t/steps/auto_attributes-01.t Sun Jul 27 09:26:09 2008
@@ -12,7 +12,10 @@
use_ok('config::auto::attributes');
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
+);
use IO::CaptureOutput qw | capture |;
my $args = process_options( {
@@ -24,18 +27,11 @@
test_step_thru_runstep($conf, q{init::defaults}, $args);
-my ($task, $step_name, $step, $ret);
my $pkg = q{auto::attributes};
$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);
-ok($step->description(), "$step_name has description");
+my $step = test_step_constructor_and_description($conf);
{
my $rv;
@@ -44,7 +40,7 @@
sub { $rv = $step->runstep($conf); },
\$stdout,
);
- ok( defined $rv, "$step_name runstep() returned defined value" );
+ ok( defined $rv, "runstep() returned defined value" );
unlike($conf->data->get('ccflags'),
qr/HASATTRIBUTE_NEVER_WORKS/,
"'ccflags' excludes bogus attribute as expected"
@@ -57,7 +53,7 @@
=head1 NAME
-auto_attributes-01.t - test config::auto::attributes
+auto_attributes-01.t - test auto::attributes
=head1 SYNOPSIS
@@ -67,7 +63,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::auto::attributes.
+The tests in this file test auto::attributes.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_ops-01.t
==============================================================================
--- branches/parallel/t/steps/auto_ops-01.t (original)
+++ branches/parallel/t/steps/auto_ops-01.t Sun Jul 27 09:26:09 2008
@@ -12,7 +12,12 @@
use_ok('config::auto::ops');
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
+);
+
+########## ops ##########
my $args = process_options(
{
@@ -29,22 +34,14 @@
$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);
$conf->options->set('ops' => 'alpha');
{
open STDOUT, '>', "/dev/null" or croak "Unable to open to myout";
my $ret = $step->runstep($conf);
close STDOUT or croak "Unable to close after myout";
- ok( $ret, "$step_name runstep() returned true value" );
+ ok( $ret, "runstep() returned true value" );
}
pass("Completed all tests in $0");
Modified: branches/parallel/t/steps/auto_pmc-01.t
==============================================================================
--- branches/parallel/t/steps/auto_pmc-01.t (original)
+++ branches/parallel/t/steps/auto_pmc-01.t Sun Jul 27 09:26:09 2008
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 32;
+use Test::More tests => 36;
use Carp;
use Cwd;
use File::Path qw| mkpath |;
@@ -15,7 +15,12 @@
use_ok('config::auto::pmc');
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
+);
+
+########## regular ##########
my $args = process_options(
{
@@ -35,21 +40,15 @@
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 $ret = $step->runstep($conf);
-ok( $ret, "$step_name runstep() returned true value" );
+ok( $ret, "runstep() returned true value" );
$conf->replenish($serialized);
+########## contains_pccmethod() ##########
+
$args = process_options(
{
argv => [ ],
@@ -58,13 +57,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" );
-
+$step = test_step_constructor_and_description($conf);
my $cwd = cwd();
{
my $tdir = tempdir( CLEANUP => 1 );
@@ -95,6 +88,8 @@
ok( chdir $cwd, 'changed back to original directory after testing' );
}
+########## get_pmc_order() ##########
+
{
my $tdir = tempdir( CLEANUP => 1 );
ok( chdir $tdir, 'changed to temp directory for testing' );
@@ -148,6 +143,8 @@
$conf->replenish($serialized);
+########## --pmc ##########
+
my @dummy_options = qw(
default.pmc null.pmc env.pmc key.pmc random.pmc unmanagedstruct.pmc
managedstruct.pmc delegate.pmc exception.pmc vtablecache.pmc parrotio.pmc
parrotlibrary.pmc parrotinterpreter.pmc parrotthread.pmc lexpad.pmc timer.pmc
pointer.pmc sub.pmc closure.pmc continuation.pmc retcontinuation.pmc
exception_handler.pmc coroutine.pmc eval.pmc nci.pmc float.pmc integer.pmc
bigint.pmc complex.pmc string.pmc boolean.pmc ref.pmc sharedref.pmc array.pmc
fixedintegerarray.pmc intlist.pmc iterator.pmc sarray.pmc fixedstringarray.pmc
multiarray.pmc hash.pmc orderedhash.pmc tqueue.pmc os.pmc file.pmc
addrregistry.pmc bound_nci.pmc capture.pmc class.pmc codestring.pmc
deleg_pmc.pmc enumerate.pmc exporter.pmc fixedbooleanarray.pmc
fixedfloatarray.pmc fixedpmcarray.pmc lexinfo.pmc multisub.pmc namespace.pmc
object.pmc pair.pmc parrotrunningthread.pmc pccmethod_test.pmc pmcproxy.pmc
resizablebooleanarray.pmc resizablefloatarray.pmc resizableintegerarray.pmc
resizablepmcarray.pmc resizablestringarra
y.pmc role.pmc scalar.pmc scheduler.pmc slice.pmc stmlog.pmc stmref.pmc
stmvar.pmc task.pmc undef.pmc
);
@@ -161,19 +158,14 @@
);
$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" );
$conf->replenish($serialized);
+########## --pmc ##########
+
@dummy_options = qw(
default.pmc null.pmc env.pmc key.pmc random.pmc unmanagedstruct.pmc
managedstruct.pmc delegate.pmc constexception.pmc vtablecache.pmc parrotio.pmc
parrotlibrary.pmc parrotinterpreter.pmc parrotthread.pmc lexpad.pmc timer.pmc
pointer.pmc sub.pmc closure.pmc continuation.pmc retcontinuation.pmc
exception_handler.pmc coroutine.pmc eval.pmc nci.pmc float.pmc integer.pmc
bigint.pmc complex.pmc string.pmc boolean.pmc ref.pmc sharedref.pmc array.pmc
fixedintegerarray.pmc intlist.pmc iterator.pmc sarray.pmc fixedstringarray.pmc
multiarray.pmc hash.pmc orderedhash.pmc tqueue.pmc os.pmc file.pmc
addrregistry.pmc bound_nci.pmc capture.pmc class.pmc codestring.pmc
deleg_pmc.pmc enumerate.pmc exporter.pmc fixedbooleanarray.pmc
fixedfloatarray.pmc fixedpmcarray.pmc lexinfo.pmc multisub.pmc namespace.pmc
object.pmc pair.pmc parrotrunningthread.pmc pccmethod_test.pmc pmcproxy.pmc
resizablebooleanarray.pmc resizablefloatarray.pmc resizableintegerarray.pmc
resizablepmcarray.pmc resizablestringarray.pmc role.pmc scalar.pmc
scheduler.pmc slice.pmc stmlog.pmc st
mref.pmc stmvar.pmc task.pmc undef.pmc
@@ -188,16 +180,9 @@
);
$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" );
pass("Completed all tests in $0");
@@ -205,7 +190,7 @@
=head1 NAME
-auto_pmc-01.t - test config::auto::pmc
+auto_pmc-01.t - test auto::pmc
=head1 SYNOPSIS
@@ -215,8 +200,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines found in config::auto::pmc in
-the most ordinary case.
+The tests in this file test auto::pmc.
=head1 AUTHOR
Modified: branches/parallel/t/steps/auto_warnings-01.t
==============================================================================
--- branches/parallel/t/steps/auto_warnings-01.t (original)
+++ branches/parallel/t/steps/auto_warnings-01.t Sun Jul 27 09:26:09 2008
@@ -16,7 +16,6 @@
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
);
use IO::CaptureOutput qw | capture |;
@@ -146,7 +145,7 @@
=head1 NAME
-auto_warnings-01.t - test config::auto::warnings
+auto_warnings-01.t - test auto::warnings
=head1 SYNOPSIS
@@ -156,7 +155,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test aspects of config::auto::warnings.
+The tests in this file test aspects of auto::warnings.
=head1 AUTHOR
Modified: branches/parallel/t/steps/init_optimize-01.t
==============================================================================
--- branches/parallel/t/steps/init_optimize-01.t (original)
+++ branches/parallel/t/steps/init_optimize-01.t Sun Jul 27 09:26:09 2008
@@ -13,7 +13,6 @@
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
);
use IO::CaptureOutput qw | capture |;
@@ -126,7 +125,7 @@
=head1 NAME
-init_optimize-01.t - test config::init::optimize
+init_optimize-01.t - test init::optimize
=head1 SYNOPSIS
@@ -136,7 +135,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::init::optimize.
+The tests in this file test init::optimize.
=head1 AUTHOR
Modified: branches/parallel/t/steps/inter_charset-01.t
==============================================================================
--- branches/parallel/t/steps/inter_charset-01.t (original)
+++ branches/parallel/t/steps/inter_charset-01.t Sun Jul 27 09:26:09 2008
@@ -14,11 +14,12 @@
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
);
use Tie::Filehandle::Preempt::Stdin;
+########## ask ##########
+
my $args = process_options(
{
argv => [],
@@ -47,6 +48,8 @@
$conf->replenish($serialized);
+########## ask ##########
+
$args = process_options(
{
argv => [ q{--ask} ],
@@ -84,7 +87,7 @@
=head1 NAME
-inter_charset-01.t - test config::inter::charset
+inter_charset-01.t - test inter::charset
=head1 SYNOPSIS
@@ -94,7 +97,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::inter::charset.
+The tests in this file test inter::charset.
=head1 AUTHOR
Modified: branches/parallel/t/steps/inter_encoding-01.t
==============================================================================
--- branches/parallel/t/steps/inter_encoding-01.t (original)
+++ branches/parallel/t/steps/inter_encoding-01.t Sun Jul 27 09:26:09 2008
@@ -14,11 +14,12 @@
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
);
use Tie::Filehandle::Preempt::Stdin;
+########## no ask ##########
+
my $args = process_options(
{
argv => [],
@@ -47,6 +48,8 @@
$conf->replenish($serialized);
+########## ask; $ENV{TEST_ENCODING} ##########
+
$ENV{TEST_ENCODING} = 'fixed_8.c';
do config::inter::encoding;
$args = process_options(
@@ -80,7 +83,7 @@
=head1 NAME
-inter_encoding-01.t - test config::inter::encoding
+inter_encoding-01.t - test inter::encoding
=head1 SYNOPSIS
@@ -90,7 +93,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::inter::encoding.
+The tests in this file test inter::encoding.
=head1 AUTHOR
Modified: branches/parallel/t/steps/inter_libparrot-01.t
==============================================================================
--- branches/parallel/t/steps/inter_libparrot-01.t (original)
+++ branches/parallel/t/steps/inter_libparrot-01.t Sun Jul 27 09:26:09 2008
@@ -15,7 +15,6 @@
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
);
use Tie::Filehandle::Preempt::Stdin;
@@ -270,7 +269,7 @@
=head1 NAME
-inter_libparrot-01.t - test config::inter::libparrot
+inter_libparrot-01.t - test inter::libparrot
=head1 SYNOPSIS
@@ -280,7 +279,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::inter::libparrot.
+The tests in this file test inter::libparrot.
=head1 AUTHOR
Modified: branches/parallel/t/steps/inter_shlibs-01.t
==============================================================================
--- branches/parallel/t/steps/inter_shlibs-01.t (original)
+++ branches/parallel/t/steps/inter_shlibs-01.t Sun Jul 27 09:26:09 2008
@@ -14,11 +14,12 @@
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
);
use Tie::Filehandle::Preempt::Stdin;
+########## ask; mock response to prompt ##########
+
my $args = process_options(
{
argv => [q{--ask}],
@@ -60,6 +61,8 @@
$conf->replenish($serialized);
+########## ask; empty response to prompt ##########
+
$args = process_options(
{
argv => [q{--ask}],
@@ -93,7 +96,7 @@
=head1 NAME
-inter_shlibs-01.t - test config::inter::shlibs
+inter_shlibs-01.t - test inter::shlibs
=head1 SYNOPSIS
@@ -103,7 +106,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::inter::shlibs.
+The tests in this file test inter::shlibs.
=head1 AUTHOR
Modified: branches/parallel/t/steps/inter_types-01.t
==============================================================================
--- branches/parallel/t/steps/inter_types-01.t (original)
+++ branches/parallel/t/steps/inter_types-01.t Sun Jul 27 09:26:09 2008
@@ -14,11 +14,12 @@
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
);
use Tie::Filehandle::Preempt::Stdin;
+########## no ask ##########
+
my $args = process_options(
{
argv => [],
@@ -43,6 +44,8 @@
$conf->replenish($serialized);
+########## ask ##########
+
$args = process_options(
{
argv => [q{--ask}],
@@ -80,7 +83,7 @@
=head1 NAME
-inter_types-01.t - test config::inter::types
+inter_types-01.t - test inter::types
=head1 SYNOPSIS
@@ -90,7 +93,7 @@
The files in this directory test functionality used by F<Configure.pl>.
-The tests in this file test subroutines exported by config::inter::types.
+The tests in this file test inter::types.
=head1 AUTHOR