From 4b8f55f044b8f67a0b83d22940a927bd964257b1 Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Sun, 15 Oct 2017 07:34:13 +1300 Subject: [PATCH] dev-perl/Apache-Test: Restore & Fix tests - EAPI6 - Resurrected tests for the first time since 2004, please open a bug if there is actually a problem still - Expand tests to dummy-compile all modules, finding and fixing 3 bugs in the process. Package-Manager: Portage-2.3.8, Repoman-2.3.3 --- .../Apache-Test/Apache-Test-1.400.0-r2.ebuild | 94 +++++++++++++++++++ .../Apache-Test-1.400.0-catfile-import.patch | 26 +++++ ...e-Test-1.400.0-fix-missing-semicolon.patch | 26 +++++ .../files/Apache-Test-1.400.0-phpclient.patch | 29 ++++++ 4 files changed, 175 insertions(+) create mode 100644 dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild create mode 100644 dev-perl/Apache-Test/files/Apache-Test-1.400.0-catfile-import.patch create mode 100644 dev-perl/Apache-Test/files/Apache-Test-1.400.0-fix-missing-semicolon.patch create mode 100644 dev-perl/Apache-Test/files/Apache-Test-1.400.0-phpclient.patch diff --git a/dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild b/dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild new file mode 100644 index 000000000000..2c4a9339e935 --- /dev/null +++ b/dev-perl/Apache-Test/Apache-Test-1.400.0-r2.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DIST_AUTHOR=SHAY +DIST_VERSION=1.40 +inherit depend.apache perl-module + +DESCRIPTION="Test.pm wrapper with helpers for testing Apache" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="" + +DEPEND="virtual/perl-ExtUtils-MakeMaker" + +need_apache + +PATCHES=( + "${FILESDIR}/${P}-catfile-import.patch" + "${FILESDIR}/${P}-fix-missing-semicolon.patch" + "${FILESDIR}/${P}-phpclient.patch" +) + +pkg_setup() { + perl_set_version +} + +src_install() { + # This is to avoid conflicts with a deprecated Apache::Test stepping + # in and causing problems/install errors + if [ -f "${S}"/.mypacklist ]; + then + rm -f "${S}"/.mypacklist + fi + perl-module_src_install +} +# Parallel tests seem to be bad. +DIST_TEST="do" +src_test() { + local MODULES=( + "Apache::Test ${DIST_VERSION}" + "Apache::Test5005compat 0.01" + "Apache::TestBuild" + "Apache::TestClient" + "Apache::TestCommon" + "Apache::TestCommonPost" + "Apache::TestConfig" + "Apache::TestConfigC" + "Apache::TestConfigPHP" + "Apache::TestConfigParrot" + "Apache::TestConfigParse" + "Apache::TestConfigPerl" + "Apache::TestHandler" + "Apache::TestHarness" + "Apache::TestHarnessPHP" + "Apache::TestMB" + "Apache::TestMM" + "Apache::TestPerlDB" + "Apache::TestReport" + "Apache::TestReportPerl" + "Apache::TestRequest" + "Apache::TestRun" + "Apache::TestRunPHP 1.00" + "Apache::TestRunParrot 1.00" + "Apache::TestRunPerl 1.00" + "Apache::TestSSLCA" + "Apache::TestServer" + "Apache::TestSmoke" + "Apache::TestSmokePerl" + "Apache::TestSort" + "Apache::TestTrace 0.01" + "Apache::TestUtil 0.02" + "Bundle::ApacheTest ${DISTVERSION}" + ) + local failed=() + for dep in "${MODULES[@]}"; do + ebegin "Compile testing ${dep}" + perl -Mblib="${S}" -M"${dep} ()" -e1 + eend $? || failed+=( "$dep" ) + done + if [[ ${failed[@]} ]]; then + echo + eerror "One or more modules failed compile:"; + for dep in "${failed[@]}"; do + eerror " ${dep}" + done + die "Failing due to module compilation errors"; + fi + perl_rm_files t/more/02testmore.t t/more/04testmore.t + perl-module_src_test +} diff --git a/dev-perl/Apache-Test/files/Apache-Test-1.400.0-catfile-import.patch b/dev-perl/Apache-Test/files/Apache-Test-1.400.0-catfile-import.patch new file mode 100644 index 000000000000..8bd6dbfddf62 --- /dev/null +++ b/dev-perl/Apache-Test/files/Apache-Test-1.400.0-catfile-import.patch @@ -0,0 +1,26 @@ +From f06bb625c7feb44bf9b5c13617522ce57cdad84e Mon Sep 17 00:00:00 2001 +From: Kent Fredric +Date: Sun, 15 Oct 2017 06:16:45 +1300 +Subject: Fix missing import of "catfile" + +Bug: https://rt.cpan.org/Ticket/Display.html?id=123283 +--- + lib/Apache/TestConfigParse.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Apache/TestConfigParse.pm b/lib/Apache/TestConfigParse.pm +index 88a19af..8fe0fe4 100644 +--- a/lib/Apache/TestConfigParse.pm ++++ b/lib/Apache/TestConfigParse.pm +@@ -23,7 +23,7 @@ use warnings FATAL => 'all'; + + use Apache::TestTrace; + +-use File::Spec::Functions qw(rel2abs splitdir file_name_is_absolute); ++use File::Spec::Functions qw(rel2abs splitdir file_name_is_absolute catfile); + use File::Basename qw(dirname basename); + + sub strip_quotes { +-- +2.14.2 + diff --git a/dev-perl/Apache-Test/files/Apache-Test-1.400.0-fix-missing-semicolon.patch b/dev-perl/Apache-Test/files/Apache-Test-1.400.0-fix-missing-semicolon.patch new file mode 100644 index 000000000000..f09cd53348fc --- /dev/null +++ b/dev-perl/Apache-Test/files/Apache-Test-1.400.0-fix-missing-semicolon.patch @@ -0,0 +1,26 @@ +From b2a2cdc1e9a3121ea8848ab4a2410c5dcc68d620 Mon Sep 17 00:00:00 2001 +From: Kent Fredric +Date: Sun, 15 Oct 2017 06:15:47 +1300 +Subject: Fix missing ";" + +Bug: https://rt.cpan.org/Ticket/Display.html?id=123282 +--- + lib/Apache/TestConfigPHP.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Apache/TestConfigPHP.pm b/lib/Apache/TestConfigPHP.pm +index 0ddea0b..1c79865 100644 +--- a/lib/Apache/TestConfigPHP.pm ++++ b/lib/Apache/TestConfigPHP.pm +@@ -170,7 +170,7 @@ sub configure_php_ini { + my $dir = catfile $self->{vars}->{serverroot}, 'conf'; + my $file = catfile $dir, 'php.ini'; + +- return if -e $file ++ return if -e $file; + + my $log = catfile $self->{vars}->{t_logs}, 'error_log'; + +-- +2.14.2 + diff --git a/dev-perl/Apache-Test/files/Apache-Test-1.400.0-phpclient.patch b/dev-perl/Apache-Test/files/Apache-Test-1.400.0-phpclient.patch new file mode 100644 index 000000000000..cecf7de10850 --- /dev/null +++ b/dev-perl/Apache-Test/files/Apache-Test-1.400.0-phpclient.patch @@ -0,0 +1,29 @@ +From 2dbb0fcab02ea60c0ca5e6ab4150691ffcfb8d7c Mon Sep 17 00:00:00 2001 +From: Kent Fredric +Date: Sun, 15 Oct 2017 06:47:45 +1300 +Subject: Don't die at load time due to undeclared '$phpclient' + +Bug: https://rt.cpan.org/Ticket/Display.html?id=123284 +--- + lib/Apache/TestHarnessPHP.pm | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/lib/Apache/TestHarnessPHP.pm b/lib/Apache/TestHarnessPHP.pm +index 90fdedc..806ba6f 100644 +--- a/lib/Apache/TestHarnessPHP.pm ++++ b/lib/Apache/TestHarnessPHP.pm +@@ -90,11 +90,6 @@ sub get_tests { + 'make sure php is in your PATH'); + @tests = grep { not /\.php$/ } @tests; + } +- elsif (! $phpclient) { +- warning(join ' - ', 'skipping *.php tests', +- 'Test::Harness 2.38 not available'); +- @tests = grep { not /\.php$/ } @tests; +- } + + return @tests; + } +-- +2.14.2 + -- 2.26.2