[Bug 992734] perl-Test-Class: FTBFS in rawhide
bugzilla at redhat.com
bugzilla at redhat.com
Wed Aug 7 14:03:44 UTC 2013
https://bugzilla.redhat.com/show_bug.cgi?id=992734
--- Comment #7 from Petr Pisar <ppisar at redhat.com> ---
Hm, no. It's caused by this Test-Simple commit:
commit 497965306444982d4948e24811e44e72619885f8
Author: Michael G. Schwern <schwern at pobox.com>
Date: Mon Apr 15 17:13:43 2013 +0100
Fix Test::Builder::Tester so it works with subtests.
They already work in TB1.5 and this wasn't hard to fix.
For #350
diff --git a/lib/Test/Builder/Tester.pm b/lib/Test/Builder/Tester.pm
index 573c818..2c49cf4 100644
--- a/lib/Test/Builder/Tester.pm
+++ b/lib/Test/Builder/Tester.pm
@@ -98,15 +98,13 @@ my $err = tie *$error_handle,
"Test::Builder::Tester::Tie",
# for remembering that we're testing and where we're testing at
my $testing = 0;
my $testing_num;
+my $original_is_passing;
# remembering where the file handles were originally connected
my $original_output_handle;
my $original_failure_handle;
my $original_todo_handle;
-my $original_test_number;
-my $original_harness_state;
-
my $original_harness_env;
# function that starts testing and redirects the filehandles for now
@@ -134,6 +132,8 @@ sub _start_testing {
$testing = 1;
$testing_num = $t->current_test;
$t->current_test(0);
+ $original_is_passing = $t->is_passing;
+ $t->is_passing(1);
# look, we shouldn't do the ending stuff
$t->no_ending(1);
@@ -329,6 +329,7 @@ sub test_test {
# restore the test no, etc, back to the original point
$t->current_test($testing_num);
$testing = 0;
+ $t->is_passing($original_is_passing);
# re-enable the original setting of the harness
$ENV{HARNESS_ACTIVE} = $original_harness_env;
@@ -469,11 +470,19 @@ sub expect {
my @checks = @_;
foreach my $check (@checks) {
+ $check = $self->_account_for_subtest($check);
$check = $self->_translate_Failed_check($check);
push @{ $self->{wanted} }, ref $check ? $check : "$check\n";
}
}
+sub _account_for_subtest {
+ my( $self, $check ) = @_;
+
+ # Since we ship with Test::Builder, calling a private method is
safe...ish.
+ return $t->_indent . $check;
+}
+
sub _translate_Failed_check {
my( $self, $check ) = @_;
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=9idkdQmyuU&a=cc_unsubscribe
More information about the perl-devel
mailing list