summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2011-04-17 20:10:17 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2011-04-17 20:10:17 +0000
commit89dad5c2c602aa228d5bd1db720695dbe47d2fb3 (patch)
treeee8e489e123cf9d67f05955140c5a15bdc77c1af /15030_all_fix_perl_test_harness.patch
parentDocument patch. (diff)
downloadmysql-extras-89dad5c2c602aa228d5bd1db720695dbe47d2fb3.tar.gz
mysql-extras-89dad5c2c602aa228d5bd1db720695dbe47d2fb3.tar.bz2
mysql-extras-89dad5c2c602aa228d5bd1db720695dbe47d2fb3.zip
Add a fix for test-unit due to Perl Test::Harness changes.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to '15030_all_fix_perl_test_harness.patch')
-rw-r--r--15030_all_fix_perl_test_harness.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/15030_all_fix_perl_test_harness.patch b/15030_all_fix_perl_test_harness.patch
new file mode 100644
index 0000000..bd6d845
--- /dev/null
+++ b/15030_all_fix_perl_test_harness.patch
@@ -0,0 +1,35 @@
+Update Test::Harness usage for Test-Harness-3*
+
+Test-Harness-2 and older directly executed testcases that did not end in .t.
+In version 3, this is no longer the case, and Test::Harness is now a thin
+wrapper around TAP::Harness. To make the testcases work again, we introduce a
+subclass of TAP::Harness, that allows direct execution where needed.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+--- mysql/unittest/unit.pl.orig 2011-04-17 18:12:47.104981268 +0000
++++ mysql/unittest/unit.pl 2011-04-17 19:05:46.520096987 +0000
+@@ -93,7 +93,23 @@
+ # Removing the first './' from the file names
+ foreach (@files) { s!^\./!! }
+ $ENV{'HARNESS_PERL_SWITCHES'} .= q" -e 'exec @ARGV'";
++ $ENV{'HARNESS_SUBCLASS'} = qw(TAP::Harness::Exec);
+ runtests @files;
+ }
+ }
+
++package TAP::Harness::Exec;
++use base qw(TAP::Harness);
++sub new {
++ my ($class, $arg_for ) = @_;
++ $arg_for ||= {};
++ $arg_for->{exec} = sub {
++ my ( $harness, $test_file ) = @_;
++ return undef if $test_file =~ /[.]t$/;
++ return [ $test_file ] if -x $test_file;
++ # This is a failure now
++ return undef;
++ };
++ return $class->SUPER::new( $arg_for );
++}
++1;