File: suite.t

package info (click to toggle)
libplack-handler-anyevent-fcgi-perl 0.01-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 172 kB
  • sloc: perl: 1,505; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use strict;
use warnings;
use Test::More;
use Plack;
use Plack::Handler::AnyEvent::FCGI;
use Plack::Test::Suite;
use t::FCGIUtils;

my $lighty_port;
my $fcgi_port;

test_lighty_external(
   sub {
       ($lighty_port, $fcgi_port) = @_;
       Plack::Test::Suite->run_server_tests(\&run_server, $fcgi_port, $lighty_port);
       done_testing();
    }
);

sub run_server {
    my($port, $app) = @_;

    $| = 0; # Test::Builder autoflushes this. reset!

    my $server = Plack::Handler::AnyEvent::FCGI->new(
        host       => '127.0.0.1',
        listen     => [ ":$port" ],
    );
    $server->run($app);
}