httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject svn commit: r153634 - httpd/apreq/trunk/win32/Configure.pl
Date Sun, 13 Feb 2005 15:56:54 GMT
Author: randyk
Date: Sun Feb 13 07:56:53 2005
New Revision: 153634

URL: http://svn.apache.org/viewcvs?view=rev&rev=153634
Log:
Use Test::Harness to run t/ tests.

Modified:
    httpd/apreq/trunk/win32/Configure.pl

Modified: httpd/apreq/trunk/win32/Configure.pl
URL: http://svn.apache.org/viewcvs/httpd/apreq/trunk/win32/Configure.pl?view=diff&r1=153633&r2=153634
==============================================================================
--- httpd/apreq/trunk/win32/Configure.pl (original)
+++ httpd/apreq/trunk/win32/Configure.pl Sun Feb 13 07:56:53 2005
@@ -34,6 +34,10 @@
 
 check_depends();
 
+my @tests = qw(cookie parsers params version);
+my @test_files = map {catfile('t', "$_.t")} @tests;
+generate_tests($apreq_home, \@tests);
+
 my %apr_libs;
 my %map = (apr => 'libapr.lib', apu => 'libaprutil.lib');
 my $devnull = devnull();
@@ -62,7 +66,7 @@
 PERL=$^X
 RM_F=\$(PERL) -MExtUtils::Command -e rm_f
 DOXYGEN_CONF=\$(APREQ_HOME)\\build\\doxygen.conf.win32
-
+TEST_FILES = @test_files
 END
 
 print $make $_ while (<DATA>);
@@ -77,7 +81,7 @@
 TEST: $(LIBAPREQ) $(MOD)
 	$(MAKE) /nologo /f $(CFG_HOME)\$(APREQ2_TEST).mak CFG="$(APREQ2_TEST) - Win32 $(CFG)" APACHE="$(APACHE)"
APREQ_HOME="$(APREQ_HOME)" APR_LIB="$(APR_LIB)" APU_LIB="$(APU_LIB)"
         set PATH=$(APREQ_HOME)\win32\libs;$(APACHE)\bin;$(PATH)
-        cd $(LIBDIR) && $(TESTALL).exe -v
+        $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness()" $(TEST_FILES)
         cd $(APREQ_HOME)
 	$(MAKE) /nologo /f $(CFG_HOME)\$(CGITEST).mak CFG="$(CGITEST) - Win32 $(CFG)" APACHE="$(APACHE)"
APREQ_HOME="$(APREQ_HOME)" APR_LIB="$(APR_LIB)" APU_LIB="$(APU_LIB)"
         if not exist "$(APREQ_ENV)\t\cgi-bin" mkdir "$(APREQ_ENV)\t\cgi-bin"
@@ -339,6 +343,20 @@
                 or warn "system @args failed: $?";
         }
     }
+}
+
+sub generate_tests {
+  my ($top, $test_files) = @_;
+  my $t = catdir $top, 't';
+  foreach my $test(@$test_files) {
+    my $file = catfile $t, $test;
+    open my $fh, '>', "$file.t" || die "Cannot open $file.t: $!";
+    print $fh <<"EOT";
+#!$^X
+exec '$file';
+EOT
+    close $fh;
+  }
 }
 
 sub fetch_apxs {



Mime
View raw message