[svn:parrot] r47232 - in branches/tt1452_configure_debug: config/gen t/steps/gen

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Mon May 31 17:21:50 UTC 2010


Author: jkeenan
Date: Mon May 31 17:21:49 2010
New Revision: 47232
URL: https://trac.parrot.org/parrot/changeset/47232

Log:
Update config step and test file to reflect change in handling of verbose debugging output.

Modified:
   branches/tt1452_configure_debug/config/gen/opengl.pm
   branches/tt1452_configure_debug/t/steps/gen/opengl-01.t

Modified: branches/tt1452_configure_debug/config/gen/opengl.pm
==============================================================================
--- branches/tt1452_configure_debug/config/gen/opengl.pm	Mon May 31 14:58:00 2010	(r47231)
+++ branches/tt1452_configure_debug/config/gen/opengl.pm	Mon May 31 17:21:49 2010	(r47232)
@@ -457,8 +457,6 @@
         return 1;
     }
 
-    my $verbose = $conf->options->get('verbose') || 0;
-
     my @include_paths_win32 = grep /\S/ => split /;/ => ($ENV{INCLUDE} || '');
 
     my $osname = $conf->data->get('osname');

Modified: branches/tt1452_configure_debug/t/steps/gen/opengl-01.t
==============================================================================
--- branches/tt1452_configure_debug/t/steps/gen/opengl-01.t	Mon May 31 14:58:00 2010	(r47231)
+++ branches/tt1452_configure_debug/t/steps/gen/opengl-01.t	Mon May 31 17:21:49 2010	(r47232)
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  7;
+use Test::More tests =>  20;
 use Carp;
 use lib qw( lib );
 use_ok('config::gen::opengl');
@@ -14,6 +14,7 @@
 use Parrot::Configure::Test qw(
     test_step_constructor_and_description
 );
+use IO::CaptureOutput qw( capture );
 
 ########## regular ##########
 
@@ -27,17 +28,84 @@
 my $conf = Parrot::Configure::Step::Test->new;
 $conf->include_config_results( $args );
 
-my $pkg = q{gen::opengl};
+my ($pkg, $step, $result);
+my $serialized = $conf->pcfreeze();
+
+$pkg = q{gen::opengl};
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
-my $step = test_step_constructor_and_description($conf);
+$step = test_step_constructor_and_description($conf);
 
 ##### mock no OpenGL #####
 $conf->data->set( has_opengl => 0 );
-my $result = $step->runstep($conf);
+$result = $step->runstep($conf);
 ok($result, "runstep() returned true value");
 is($step->result(), q{skipped}, "Got expected result when no 'has_opengl'" );
 
+$conf->replenish($serialized);
+
+########### verbose ###########
+
+($args, $step_list_ref) = process_options( {
+    argv => [ q{--verbose} ],
+    mode => q{configure},
+} );
+
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+{
+    my ($stdout, $stderr);
+    capture(
+        sub { $result = $step->runstep($conf); },
+        \$stdout,
+        \$stderr,
+    );
+    ok($result, "runstep() returned true value");
+    like( $stdout,
+        qr/Checking for OpenGL headers using the following globs/s,
+        "Got expected verbose output"
+    );
+    like( $stdout,
+        qr/Found the following OpenGL headers/s,
+        "Got expected verbose output"
+    );
+    like( $stdout,
+        qr/PASS\s+FAIL\s+IGNORE\s+HEADER/s,
+        "Got expected verbose output"
+    );
+    like( $stdout,
+        qr/unique signatures successfully translated/s,
+        "Got expected verbose output"
+    );
+}
+
+$conf->replenish($serialized);
+
+########### extra verbose ###########
+
+($args, $step_list_ref) = process_options( {
+    argv => [ q{--verbose=3} ],
+    mode => q{configure},
+} );
+
+$conf->add_steps($pkg);
+$conf->options->set( %{$args} );
+$step = test_step_constructor_and_description($conf);
+{
+    my ($stdout, $stderr);
+    capture(
+        sub { $result = $step->runstep($conf); },
+        \$stdout,
+        \$stderr,
+    );
+    ok($result, "runstep() returned true value");
+    like( $stdout,
+        qr/COUNT\s+NCI SIGNATURE/s,
+        "Got expected verbose output"
+    );
+}
+
 pass("Completed all tests in $0");
 
 ################### DOCUMENTATION ###################


More information about the parrot-commits mailing list