[svn:parrot] r47183 - in branches/tt1452_configure_debug/t/steps: auto gen
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Mon May 31 02:13:44 UTC 2010
Author: jkeenan
Date: Mon May 31 02:13:44 2010
New Revision: 47183
URL: https://trac.parrot.org/parrot/changeset/47183
Log:
Update test file to reflect change in handling of verbose debugging output.
Modified:
branches/tt1452_configure_debug/t/steps/auto/ctags-01.t
branches/tt1452_configure_debug/t/steps/auto/gettext-01.t
branches/tt1452_configure_debug/t/steps/auto/opengl-01.t
branches/tt1452_configure_debug/t/steps/auto/pcre-01.t
branches/tt1452_configure_debug/t/steps/auto/zlib-01.t
branches/tt1452_configure_debug/t/steps/gen/platform-01.t
Modified: branches/tt1452_configure_debug/t/steps/auto/ctags-01.t
==============================================================================
--- branches/tt1452_configure_debug/t/steps/auto/ctags-01.t Mon May 31 02:13:34 2010 (r47182)
+++ branches/tt1452_configure_debug/t/steps/auto/ctags-01.t Mon May 31 02:13:44 2010 (r47183)
@@ -100,14 +100,14 @@
} );
$conf->options->set( %{$args} );
$step = test_step_constructor_and_description($conf);
-ok(auto::ctags::_probe_for_ctags_output('Exuberant Ctags', 0),
+ok(auto::ctags::_probe_for_ctags_output($conf, 'Exuberant Ctags'),
"Probe returned true when output matched");
-ok(! auto::ctags::_probe_for_ctags_output('alpha', 0),
+ok(! auto::ctags::_probe_for_ctags_output($conf, 'alpha'),
"Probe returned false when output matched");
{
my $stdout;
my $rv = capture(
- sub { auto::ctags::_probe_for_ctags_output('Exuberant Ctags', 1) },
+ sub { auto::ctags::_probe_for_ctags_output($conf, 'Exuberant Ctags') },
\$stdout
);
ok($rv, "Probe returned true when output matched");
@@ -115,7 +115,7 @@
{
my $stdout;
my $rv = capture(
- sub { auto::ctags::_probe_for_ctags_output('alpha', 1) },
+ sub { auto::ctags::_probe_for_ctags_output($conf, 'alpha') },
\$stdout
);
ok(! $rv, "Probe returned false when output matched");
Modified: branches/tt1452_configure_debug/t/steps/auto/gettext-01.t
==============================================================================
--- branches/tt1452_configure_debug/t/steps/auto/gettext-01.t Mon May 31 02:13:34 2010 (r47182)
+++ branches/tt1452_configure_debug/t/steps/auto/gettext-01.t Mon May 31 02:13:44 2010 (r47183)
@@ -112,12 +112,12 @@
########## _evaluate_cc_run() ##########
-my ($test, $verbose);
+my $test;
my $has_gettext;
$test = "Hello, world!\n";
-$verbose = undef;
-$has_gettext = $step->_evaluate_cc_run($test, $verbose);
+$conf->options->set(verbose => undef);
+$has_gettext = $step->_evaluate_cc_run($conf, $test);
is($has_gettext, 1, "Got expected value for has_gettext");
is($step->result(), 'yes', "Expected result was set");
# Prepare for next test
@@ -126,10 +126,10 @@
{
my $stdout;
$test = "Hello, world!\n";
- $verbose = 1;
+ $conf->options->set(verbose => 1);
capture(
sub {
- $has_gettext = $step->_evaluate_cc_run($test, $verbose);
+ $has_gettext = $step->_evaluate_cc_run($conf, $test);
},
\$stdout,
);
@@ -141,8 +141,8 @@
}
$test = "Foobar\n";
-$verbose = undef;
-$has_gettext = $step->_evaluate_cc_run($test, $verbose);
+$conf->options->set(verbose => undef);
+$has_gettext = $step->_evaluate_cc_run($conf, $test);
is($has_gettext, 0, "Got expected value for has_gettext");
ok(! defined $step->result(), "As expected, result is not yet defined");
@@ -157,11 +157,11 @@
$conf->options->set( %{$args} );
$step = test_step_constructor_and_description($conf);
-$verbose = undef;
+$conf->options->set(verbose => undef);
$conf->data->set( ccflags => q{} );
$conf->data->set( libs => q{} );
my $libs = q{foo bar baz};
-ok(auto::gettext::_handle_gettext($conf, $verbose, $libs),
+ok(auto::gettext::_handle_gettext($conf, $libs),
"_handle_gettext() returned true value");
like($conf->data->get( 'ccflags' ), qr/-DHAS_GETTEXT/,
"HAS_GETTEXT was added to 'ccflags'");
@@ -172,9 +172,9 @@
$conf->data->set( libs => q{} );
{
my ($stdout, $rv);
- $verbose = 1;
+ $conf->options->set(verbose => 1);
capture(
- sub { $rv = auto::gettext::_handle_gettext($conf, $verbose, $libs); },
+ sub { $rv = auto::gettext::_handle_gettext($conf, $libs); },
\$stdout,
);
ok($rv, "_handle_gettext() returned true value");
@@ -186,6 +186,7 @@
qr/ccflags:\s.*-DHAS_GETTEXT/,
"Got expected verbose output"
);
+ $conf->options->set(verbose => undef);
}
pass("Completed all tests in $0");
Modified: branches/tt1452_configure_debug/t/steps/auto/opengl-01.t
==============================================================================
--- branches/tt1452_configure_debug/t/steps/auto/opengl-01.t Mon May 31 02:13:34 2010 (r47182)
+++ branches/tt1452_configure_debug/t/steps/auto/opengl-01.t Mon May 31 02:13:44 2010 (r47183)
@@ -5,7 +5,7 @@
use strict;
use warnings;
-use Test::More tests => 32;
+use Test::More tests => 29;
use Carp;
use lib qw( lib );
use_ok('config::auto::opengl');
@@ -138,26 +138,8 @@
my ($glut_api_version, $glut_brand);
capture(
sub { ($glut_api_version, $glut_brand) = $step->_evaluate_cc_run(
+ $conf,
$test,
- 0,
- ); },
- \$stdout,
- \$stderr,
- );
- is( $glut_api_version, $try[0],
- "Got first expected return value for _evaluate_cc_run()." );
- is( $glut_brand, $try[1],
- "Got first expected return value for _evaluate_cc_run()." );
- ok(! $stdout, "Nothing captured on STDOUT, as expected");
-}
-
-{
- my ($stdout, $stderr);
- my ($glut_api_version, $glut_brand);
- capture(
- sub { ($glut_api_version, $glut_brand) = $step->_evaluate_cc_run(
- $test,
- $conf->options->get( 'verbose' )
); },
\$stdout,
\$stderr,
@@ -171,6 +153,8 @@
qr/yes, $glut_brand API version $glut_api_version/,
"Got expected verbose output for _evaluate_cc_run()"
);
+ # prepare for next test
+ $conf->options->set(verbose => undef);
}
########## _handle_glut() ##########
Modified: branches/tt1452_configure_debug/t/steps/auto/pcre-01.t
==============================================================================
--- branches/tt1452_configure_debug/t/steps/auto/pcre-01.t Mon May 31 02:13:34 2010 (r47182)
+++ branches/tt1452_configure_debug/t/steps/auto/pcre-01.t Mon May 31 02:13:44 2010 (r47183)
@@ -98,14 +98,13 @@
# Mock different outcomes of _evaluate_cc_run
my ($test, $has_pcre);
-my $verbose = $conf->options->get('verbose');
$test = q{pcre foobar};
-ok(! $step->_evaluate_cc_run($test, $verbose),
+ok(! $step->_evaluate_cc_run($conf, $test),
"Got expected setting for HAS_PCRE");
$test = q{pcre 4.1};
-ok($step->_evaluate_cc_run($test, $verbose),
+ok($step->_evaluate_cc_run($conf, $test),
"_evaluate_cc_run returned true value as expected");
is($step->result(), q{yes, 4.1}, "Got expected PCRE version");
@@ -122,14 +121,13 @@
$step = test_step_constructor_and_description($conf);
# Mock different outcomes of _evaluate_cc_run
-$verbose = $conf->options->get('verbose');
$test = q{pcre 4.0};
{
my ($stdout, $stderr);
capture(
sub {
- $has_pcre = $step->_evaluate_cc_run($test, $verbose);
+ $has_pcre = $step->_evaluate_cc_run($conf, $test);
},
\$stdout,
);
Modified: branches/tt1452_configure_debug/t/steps/auto/zlib-01.t
==============================================================================
--- branches/tt1452_configure_debug/t/steps/auto/zlib-01.t Mon May 31 02:13:34 2010 (r47182)
+++ branches/tt1452_configure_debug/t/steps/auto/zlib-01.t Mon May 31 02:13:44 2010 (r47183)
@@ -90,8 +90,6 @@
'-lz',
"_select_lib() returned expected value");
-my $verbose = undef;
-
$conf->replenish($serialized);
########## --without-zlib; _evaluate_cc_run() ##########
@@ -105,8 +103,8 @@
my ($test, $has_zlib);
$test = qq{1.2.3\n};
$has_zlib = 0;
-$verbose = undef;
-$has_zlib = $step->_evaluate_cc_run($conf, $test, $has_zlib, $verbose);
+$conf->options->set(verbose => undef);
+$has_zlib = $step->_evaluate_cc_run($conf, $test, $has_zlib);
is($has_zlib, 1, "'has_zlib' set as expected");
is($step->result(), 'yes, 1.2.3', "Expected result was set");
# Prepare for next test
@@ -114,8 +112,8 @@
$test = qq{foobar};
$has_zlib = 0;
-$verbose = undef;
-$has_zlib = $step->_evaluate_cc_run($conf, $test, $has_zlib, $verbose);
+$conf->options->set(verbose => undef);
+$has_zlib = $step->_evaluate_cc_run($conf, $test, $has_zlib);
is($has_zlib, 0, "'has_zlib' set as expected");
ok(! defined $step->result(), "Result is undefined, as expected");
@@ -123,10 +121,10 @@
my $stdout;
$test = qq{1.2.3\n};
$has_zlib = 0;
- $verbose = 1;
+ $conf->options->set(verbose => 1);
capture(
sub { $has_zlib =
- $step->_evaluate_cc_run($conf, $test, $has_zlib, $verbose); },
+ $step->_evaluate_cc_run($conf, $test, $has_zlib); },
\$stdout,
);
is($has_zlib, 1, "'has_zlib' set as expected");
Modified: branches/tt1452_configure_debug/t/steps/gen/platform-01.t
==============================================================================
--- branches/tt1452_configure_debug/t/steps/gen/platform-01.t Mon May 31 02:13:34 2010 (r47182)
+++ branches/tt1452_configure_debug/t/steps/gen/platform-01.t Mon May 31 02:13:44 2010 (r47183)
@@ -42,18 +42,17 @@
my $platform_orig = $conf->data->get('osname');
my $archname_orig = $conf->data->get('archname');
$conf->data->set( archname => 'foo-bar' );
-my $verbose = 0;
########## _get_generated() ##########
my $TEMP_generated_orig = $conf->data->get('TEMP_generated');
{
- $verbose = 1;
+ $conf->options->set(verbose => 1);
my ($stdout, $stderr, $rv);
my $expected = q{foo};
$conf->data->set( TEMP_generated => $expected );
capture(
- sub { $rv = $step->_get_generated( $conf, $verbose ) },
+ sub { $rv = $step->_get_generated( $conf ) },
\$stdout,
\$stderr,
);
@@ -61,8 +60,8 @@
like( $stdout, qr/\($expected\)/, "Got expected verbose output");
}
$conf->data->set( TEMP_generated => undef );
-$verbose = 0;
-is( $step->_get_generated( $conf, $verbose ), q{},
+$conf->options->set(verbose => 0);
+is( $step->_get_generated( $conf ), q{},
"Got expected generated");
# re-set to original values
More information about the parrot-commits
mailing list