Author: jkeenan
Date: Sat Jul 19 17:44:42 2008
New Revision: 29623
Removed:
branches/parallel/t/steps/inter_libparrot-02.t
branches/parallel/t/steps/inter_libparrot-03.t
branches/parallel/t/steps/inter_libparrot-04.t
branches/parallel/t/steps/inter_libparrot-05.t
branches/parallel/t/steps/inter_libparrot-06.t
branches/parallel/t/steps/inter_libparrot-07.t
branches/parallel/t/steps/inter_libparrot-08.t
branches/parallel/t/steps/inter_libparrot-09.t
Modified:
branches/parallel/MANIFEST
branches/parallel/t/steps/inter_libparrot-01.t
Log:
Consolidate multiple test files per configuration step into a single file.
Modified: branches/parallel/MANIFEST
==============================================================================
--- branches/parallel/MANIFEST (original)
+++ branches/parallel/MANIFEST Sat Jul 19 17:44:42 2008
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Jul 20 00:07:28 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sun Jul 20 00:44:24 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -3672,14 +3672,6 @@
t/steps/inter_lex-03.t []
t/steps/inter_lex-05.t []
t/steps/inter_libparrot-01.t []
-t/steps/inter_libparrot-02.t []
-t/steps/inter_libparrot-03.t []
-t/steps/inter_libparrot-04.t []
-t/steps/inter_libparrot-05.t []
-t/steps/inter_libparrot-06.t []
-t/steps/inter_libparrot-07.t []
-t/steps/inter_libparrot-08.t []
-t/steps/inter_libparrot-09.t []
t/steps/inter_make-01.t []
t/steps/inter_progs-01.t []
t/steps/inter_shlibs-01.t []
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 Sat Jul 19 17:44:42 2008
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 58;
use Carp;
use lib qw( lib t/configure/testlib );
use_ok('config::init::defaults');
@@ -13,7 +13,14 @@
use_ok('config::inter::libparrot');
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
+ rerun_defaults_for_testing
+ test_step_constructor_and_description
+);
+use Tie::Filehandle::Preempt::Stdin;
+
+########## no ask; no other options ##########
my $args = process_options(
{
@@ -30,23 +37,232 @@
my $pkg = q{inter::libparrot};
$conf->add_steps($pkg);
+
+my $serialized = $conf->pcfreeze();
+
+$conf->options->set( %{$args} );
+my $step = test_step_constructor_and_description($conf);
+{
+ 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, "runstep() returned true value" );
+}
+
+$conf->replenish($serialized);
+
+########## no ask; parrot_is_shared ##########
+
+$args = process_options(
+ {
+ argv => [ q{--parrot_is_shared} ],
+ mode => q{configure},
+ }
+);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+{
+ 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, "runstep() returned true value" );
+}
+
+$conf->replenish($serialized);
+
+########## no ask; parrot_is_shared; has_dynamic_linking ##########
+
+$args = process_options(
+ {
+ argv => [ q{--parrot_is_shared} ],
+ mode => q{configure},
+ }
+);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+my $has_dynamic_linking_orig = $conf->data->get('has_dynamic_linking');
+$conf->data->set('has_dynamic_linking' => 1);
+
+{
+ 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, "runstep() returned true value" );
+}
+is($step->result(), 'yes', "Expected result was set");
+# re-set for next test
+$step->set_result(q{});
+$conf->data->set('has_dynamic_linking' => $has_dynamic_linking_orig);
+
+$conf->replenish($serialized);
+
+########## no ask; parrot_is_shared; has_dynamic_linking; rpath ##########
+
+$args = process_options(
+ {
+ argv => [ q{--parrot_is_shared} ],
+ mode => q{configure},
+ }
+);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$conf->data->set('has_dynamic_linking' => 1);
+my $rpath_orig = $conf->data->get('rpath');
+$conf->data->set('rpath' => q{-L});
+{
+ 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, "runstep() returned true value" );
+}
+is($step->result(), 'yes', "Expected result was set");
+# re-set for next test
+$step->set_result(q{});
+$conf->data->set('has_dynamic_linking' => $has_dynamic_linking_orig);
+$conf->data->set('rpath' => $rpath_orig);
+
+$conf->replenish($serialized);
+
+########## no ask; parrot_is_shared; has_dynamic_linking; rpath ##########
+
+$args = process_options(
+ {
+ argv => [ q{--parrot_is_shared} ],
+ mode => q{configure},
+ }
+);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$conf->data->set('has_dynamic_linking' => 1);
+$rpath_orig = $conf->data->get('rpath');
+$conf->data->set('rpath' => q{-L});
+{
+ 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, "runstep() returned true value" );
+}
+is($step->result(), 'yes', "Expected result was set");
+# re-set for next test
+$step->set_result(q{});
+$conf->data->set('has_dynamic_linking' => $has_dynamic_linking_orig);
+$conf->data->set('rpath' => $rpath_orig);
+
+$conf->replenish($serialized);
+
+########## no ask; libparrot_ldflags ##########
+
+$args = process_options(
+ {
+ argv => [],
+ mode => q{configure},
+ }
+);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+my $libparrot_ldflags_orig = $conf->data->get('libparrot_ldflags');
+$conf->data->set('libparrot_ldflags' => 'libparrot.lib');
+{
+ 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, "runstep() returned true value" );
+}
+$conf->data->set('libparrot_ldflags' => $libparrot_ldflags_orig);
+
+$conf->replenish($serialized);
+
+########## ask; no has_dynamic_linking ##########
+
+$args = process_options(
+ {
+ argv => [ q{--ask} ],
+ mode => q{configure},
+ }
+);
$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$conf->data->set('has_dynamic_linking' => 0);
+{
+ 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, "runstep() returned true value" );
+}
+is($step->result(), 'no', "Expected result was set");
+# re-set for next test
+$step->set_result(q{});
+$conf->data->set('has_dynamic_linking' => $has_dynamic_linking_orig);
+
+$conf->replenish($serialized);
+
+########## ask; parrot_is_shared; has_dynamic_linking ##########
+
+$args = process_options(
+ {
+ argv => [ q{--ask}, q{--parrot_is_shared} ],
+ mode => q{configure},
+ }
+);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$conf->data->set('has_dynamic_linking' => 1);
+
+my ( @prompts, $prompt, $object );
-my ( $task, $step_name, $step);
-$task = $conf->steps->[-1];
-$step_name = $task->step;
+$prompt = q{y};
+push @prompts, $prompt;
-$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" );
+$object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
+can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
+isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
{
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" );
+}
+
+undef $object;
+untie *STDIN;
+is($step->result(), 'yes', "Expected result was set");
+# re-set for next test
+$step->set_result(q{});
+$conf->data->set('has_dynamic_linking' => $has_dynamic_linking_orig);
[EMAIL PROTECTED] = ();
+
+$conf->replenish($serialized);
+
+########## ask; has_dynamic_linking ##########
+
+$args = process_options(
+ {
+ argv => [ q{--ask} ],
+ mode => q{configure},
+ }
+);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+$conf->data->set('has_dynamic_linking' => 1);
+$prompt = q{n};
+push @prompts, $prompt;
+$object = tie *STDIN, 'Tie::Filehandle::Preempt::Stdin', @prompts;
+can_ok( 'Tie::Filehandle::Preempt::Stdin', ('READLINE') );
+isa_ok( $object, 'Tie::Filehandle::Preempt::Stdin' );
+{
+ 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, "runstep() returned true value" );
}
+undef $object;
+untie *STDIN;
+is($step->result(), 'no', "Expected result was set");
+# re-set for next test
+$step->set_result(q{});
+$conf->data->set('has_dynamic_linking' => $has_dynamic_linking_orig);
[EMAIL PROTECTED] = ();
pass("Completed all tests in $0");