You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by st...@apache.org on 2004/12/06 16:25:54 UTC

svn commit: r109982 - /httpd/apreq/branches/1.x/Changes /httpd/apreq/branches/1.x/Makefile.PL

Author: stas
Date: Mon Dec  6 07:25:52 2004
New Revision: 109982

URL: http://svn.apache.org/viewcvs?view=rev&rev=109982
Log:
fix Makefile.PL to properly skip the test suite if A-T requirements
weren't satisfied

Modified:
   httpd/apreq/branches/1.x/Changes
   httpd/apreq/branches/1.x/Makefile.PL

Modified: httpd/apreq/branches/1.x/Changes
Url: http://svn.apache.org/viewcvs/httpd/apreq/branches/1.x/Changes?view=diff&rev=109982&p1=httpd/apreq/branches/1.x/Changes&r1=109981&p2=httpd/apreq/branches/1.x/Changes&r2=109982
==============================================================================
--- httpd/apreq/branches/1.x/Changes	(original)
+++ httpd/apreq/branches/1.x/Changes	Mon Dec  6 07:25:52 2004
@@ -4,6 +4,9 @@
 
 =item 1.33
 
+fix Makefile.PL to properly skip the test suite if A-T requirements
+weren't satisfied [Stas]
+
 require Apache::Test 1.13 to run perl tests (need() was added at that
 version) [Stas]
 

Modified: httpd/apreq/branches/1.x/Makefile.PL
Url: http://svn.apache.org/viewcvs/httpd/apreq/branches/1.x/Makefile.PL?view=diff&rev=109982&p1=httpd/apreq/branches/1.x/Makefile.PL&r1=109981&p2=httpd/apreq/branches/1.x/Makefile.PL&r2=109982
==============================================================================
--- httpd/apreq/branches/1.x/Makefile.PL	(original)
+++ httpd/apreq/branches/1.x/Makefile.PL	Mon Dec  6 07:25:52 2004
@@ -6,8 +6,11 @@
 use File::Path qw(mkpath);
 use lib qw(Apache-Test/lib);
 
+use constant MIN_A_T_VERSION => 2.13;
+
 use constant HAS_APACHE_TEST => eval {
-    require Apache::Test && $Apache::Test::VERSION >= 1.13;
+    require Apache::Test &&
+        $Apache::Test::VERSION >= MIN_A_T_VERSION;
 };
 
 use constant WIN32 => ($^O eq "MSWin32") || $ENV{WIN32_TEST};
@@ -35,24 +38,26 @@
 my $conf_data = join '', <DATA>;
 $conf_data =~ s|(blib/arch)|$FindBin::Bin/$1|;
 
-eval {
-  require Apache::Test;
-  # accept the configs from command line
-  Apache::TestMM::filter_args();
-  Apache::TestMM::generate_script('t/TEST');
-#    local $SIG{ALRM} = sub { die "alarm\n" };
-#    alarm 60;
-#    my %params = Apache::test->get_test_params();
-#    alarm 0;
-
-#    Apache::test->write_httpd_conf(%params, include => $conf_data);
-#    *MY::test = sub {Apache::test->MM_test(%params)};
-};
-print "\nskipping test setup...$@" if $@;
+if (HAS_APACHE_TEST) {
+    # accept the configs from command line
+    Apache::TestMM::filter_args();
+    Apache::TestMM::generate_script('t/TEST');
+}
+else {
+    print "\nskipping test setup... which requires Apache::Test " .
+    MIN_A_T_VERSION . " or higher\n";
+    *MY::test = sub {
+        return <<'EOF';
+test : pure_all
+	@echo \*** This test suite requires Apache::Test available
+	@echo \*** available from CPAN
+EOF
+    };
+}
 
 # prerequisites
 my %require = (
-    "Apache::Test" => "1.03",
+    "Apache::Test" => MIN_A_T_VERSION,
 );
 
 my $myVERSION = MM->parse_version('Request/Request.pm');