-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d92d8c7
commit b8e8623
Showing
11 changed files
with
73 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,13 +1,6 @@ | |||
APXS=@APXS@ | APXS=@APXS@ | ||
AP_SBINDIR=$(shell $(APXS) -q sbindir) | TESTS=. | ||
AP_PROGNAME=$(shell $(APXS) -q progname) | all: test | ||
HTTPD=$(AP_SBINDIR)/$(AP_PROGNAME) | test: | ||
all: conf | APXS=$(APXS) prove -I.. $(TESTS) | ||
test: test.conf | .PHONY: test | ||
prove -I.. . | |||
conf: test.conf | |||
test.conf: test.conf.tt *.t mkconf.pl | |||
./mkconf.pl --input $< --output $@ | |||
clean: | |||
rm -f test.conf | |||
.PHONY: conf clean test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,52 +1,14 @@ | |||
use strict; | use strict; | ||
use warnings; | use warnings; | ||
use Test::More; | use Test::More; | ||
use File::Temp; | |||
use Plack::Test::Suite; | use Plack::Test::Suite; | ||
require t::TestModPSGI; | |||
|
|
||
warn $ENV{HTTPD}; | BEGIN { | ||
Plack::Test::Suite->run_server_tests(\&run_httpd); | no warnings 'once'; | ||
done_testing(); | $t::TestModPSGI::TestFile = __FILE__; | ||
|
|||
sub run_httpd { | |||
my $port = shift; | |||
|
|||
my $tmpdir = $ENV{APACHE2_TMP_DIR} || File::Temp::tempdir( CLEANUP => 1 ); | |||
|
|||
write_file("$tmpdir/app.psgi", _render_psgi()); | |||
write_file("$tmpdir/httpd.conf", _render_conf($tmpdir, $port, "$tmpdir/app.psgi")); | |||
|
|||
exec "httpd -X -D FOREGROUND -f $tmpdir/httpd.conf"; | |||
} | |||
|
|||
sub write_file { | |||
my($path, $content) = @_; | |||
|
|||
open my $out, ">", $path or die "$path: $!"; | |||
print $out $content; | |||
} | } | ||
|
|
||
sub _render_psgi { | return Plack::Test::Suite->test_app_handler if t::TestModPSGI::running_in_mod_psgi(); | ||
return <<'EOF'; | Plack::Test::Suite->run_server_tests(\&t::TestModPSGI::run_httpd); | ||
use lib "lib"; | done_testing(); | ||
use Plack::Test::Suite; | |||
Plack::Test::Suite->test_app_handler; | |||
EOF | |||
} | |||
|
|||
sub _render_conf { | |||
my ($tmpdir, $port, $psgi_path) = @_; | |||
<<"END"; | |||
LoadModule psgi_module modules/mod_psgi.so | |||
PidFile $tmpdir/httpd.pid | |||
LockFile $tmpdir/httpd.lock | |||
ErrorLog $tmpdir/error_log | |||
Listen $port | |||
<Location /> | |||
SetHandler psgi | |||
PSGIApp $tmpdir/app.psgi | |||
</Location> | |||
END | |||
} |
This file was deleted.
Oops, something went wrong.