[svn:parrot] r47649 - trunk/t/steps/gen
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Tue Jun 15 22:44:18 UTC 2010
Author: jkeenan
Date: Tue Jun 15 22:44:18 2010
New Revision: 47649
URL: https://trac.parrot.org/parrot/changeset/47649
Log:
Correct functioning of tests on boxes where OpenGL is not really installed: http://trac.parrot.org/parrot/ticket/1680.
Modified:
trunk/t/steps/gen/opengl-01.t
Modified: trunk/t/steps/gen/opengl-01.t
==============================================================================
--- trunk/t/steps/gen/opengl-01.t Tue Jun 15 22:41:13 2010 (r47648)
+++ trunk/t/steps/gen/opengl-01.t Tue Jun 15 22:44:18 2010 (r47649)
@@ -28,6 +28,8 @@
my $conf = Parrot::Configure::Step::Test->new;
$conf->include_config_results( $args );
+my $real_opengl_status = $conf->data->get('has_opengl');
+
my ($pkg, $step, $result);
my $serialized = $conf->pcfreeze();
@@ -42,68 +44,78 @@
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"
- );
+SKIP: {
+ skip 'opengl not detected',
+ 13 unless $real_opengl_status;
+
+ # The complex nature of gen::opengl::runstep() makes it difficult to write
+ # tests that will DTRT when OpenGL is not really present on this machine.
+ # In particular, tests for verbose output will fail when
+ # $real_opengl_status is false. So we'll SKIP.
+
+ $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");
More information about the parrot-commits
mailing list