Use Test::Harness to run t/ tests.
git-svn-id: https://svn.apache.org/repos/asf/httpd/apreq/trunk@153634 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/win32/Configure.pl b/win32/Configure.pl
index 6fda641..bdd180e 100644
--- a/win32/Configure.pl
+++ b/win32/Configure.pl
@@ -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"
@@ -341,6 +345,20 @@
}
}
+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 {
print << 'END';