From 46afe5179e030c67e0519264f4a06ebe56d04dde Mon Sep 17 00:00:00 2001 From: Jiro Nishiguchi Date: Sun, 11 Oct 2009 01:26:15 +0900 Subject: [PATCH] use t::Config --- .gitignore | 1 + configure.ac | 2 +- t/Config.pm.in | 9 +++++++++ t/Makefile.in | 3 +-- t/TestModPSGI.pm | 8 +++++--- 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 t/Config.pm.in diff --git a/.gitignore b/.gitignore index 8d0eae8..c63659b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ Makefile /config.log /config.status /configure +/t/Config.pm diff --git a/configure.ac b/configure.ac index da5b1e8..daa095e 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,7 @@ if test "$PERL" = no; then fi AC_SUBST(PERL) -AC_OUTPUT([Makefile t/Makefile]) +AC_OUTPUT([Makefile t/Makefile t/Config.pm]) echo " $PACKAGE_NAME $PACKAGE_VERSION configuration: diff --git a/t/Config.pm.in b/t/Config.pm.in new file mode 100644 index 0000000..00a0861 --- /dev/null +++ b/t/Config.pm.in @@ -0,0 +1,9 @@ +package t::Config; +use strict; +use warnings; + +our $APXS = '@APXS@'; + +1; +__END__ + diff --git a/t/Makefile.in b/t/Makefile.in index 8f68bc7..99ad472 100644 --- a/t/Makefile.in +++ b/t/Makefile.in @@ -1,6 +1,5 @@ -APXS=@APXS@ TESTS=. all: test test: - APXS=$(APXS) prove -I.. $(TESTS) + prove -I.. $(TESTS) .PHONY: test diff --git a/t/TestModPSGI.pm b/t/TestModPSGI.pm index 316b950..57ca70e 100644 --- a/t/TestModPSGI.pm +++ b/t/TestModPSGI.pm @@ -3,6 +3,7 @@ use strict; use warnings; use Test::Base -Base; +use t::Config; use File::Basename; use URI::Escape; use List::Util qw(sum); @@ -103,9 +104,10 @@ our $TestFile; sub run_httpd($) { my $port = shift; my $tmpdir = $ENV{APACHE2_TMP_DIR} || File::Temp::tempdir(CLEANUP => 1); - chomp(my $libexecdir = `$ENV{APXS} -q libexecdir`); - chomp(my $sbindir = `$ENV{APXS} -q sbindir`); - chomp(my $progname = `$ENV{APXS} -q progname`); + my $apxs = $t::Config::APXS; + chomp(my $libexecdir = `$apxs -q libexecdir`); + chomp(my $sbindir = `$apxs -q sbindir`); + chomp(my $progname = `$apxs -q progname`); my $httpd = "$sbindir/$progname"; my $conf = <<"END_CONF"; LoadModule psgi_module $libexecdir/mod_psgi.so