Skip to content

Commit

Permalink
use t::Config
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritloose committed Oct 10, 2009
1 parent 027a9c6 commit 46afe51
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ Makefile
/config.log /config.log
/config.status /config.status
/configure /configure
/t/Config.pm
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -33,7 +33,7 @@ if test "$PERL" = no; then
fi fi
AC_SUBST(PERL) AC_SUBST(PERL)


AC_OUTPUT([Makefile t/Makefile]) AC_OUTPUT([Makefile t/Makefile t/Config.pm])


echo " echo "
$PACKAGE_NAME $PACKAGE_VERSION configuration: $PACKAGE_NAME $PACKAGE_VERSION configuration:
Expand Down
9 changes: 9 additions & 0 deletions t/Config.pm.in
@@ -0,0 +1,9 @@
package t::Config;
use strict;
use warnings;

our $APXS = '@APXS@';

1;
__END__

3 changes: 1 addition & 2 deletions t/Makefile.in
@@ -1,6 +1,5 @@
APXS=@APXS@
TESTS=. TESTS=.
all: test all: test
test: test:
APXS=$(APXS) prove -I.. $(TESTS) prove -I.. $(TESTS)
.PHONY: test .PHONY: test
8 changes: 5 additions & 3 deletions t/TestModPSGI.pm
Expand Up @@ -3,6 +3,7 @@ use strict;
use warnings; use warnings;
use Test::Base -Base; use Test::Base -Base;


use t::Config;
use File::Basename; use File::Basename;
use URI::Escape; use URI::Escape;
use List::Util qw(sum); use List::Util qw(sum);
Expand Down Expand Up @@ -103,9 +104,10 @@ our $TestFile;
sub run_httpd($) { sub run_httpd($) {
my $port = shift; my $port = shift;
my $tmpdir = $ENV{APACHE2_TMP_DIR} || File::Temp::tempdir(CLEANUP => 1); my $tmpdir = $ENV{APACHE2_TMP_DIR} || File::Temp::tempdir(CLEANUP => 1);
chomp(my $libexecdir = `$ENV{APXS} -q libexecdir`); my $apxs = $t::Config::APXS;
chomp(my $sbindir = `$ENV{APXS} -q sbindir`); chomp(my $libexecdir = `$apxs -q libexecdir`);
chomp(my $progname = `$ENV{APXS} -q progname`); chomp(my $sbindir = `$apxs -q sbindir`);
chomp(my $progname = `$apxs -q progname`);
my $httpd = "$sbindir/$progname"; my $httpd = "$sbindir/$progname";
my $conf = <<"END_CONF"; my $conf = <<"END_CONF";
LoadModule psgi_module $libexecdir/mod_psgi.so LoadModule psgi_module $libexecdir/mod_psgi.so
Expand Down

0 comments on commit 46afe51

Please sign in to comment.