File: setupenv.t

package info (click to toggle)
libapache2-mod-perl2 2.0.13-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 12,016 kB
  • sloc: perl: 97,771; ansic: 14,493; makefile: 51; sh: 18
file content (47 lines) | stat: -rw-r--r-- 1,473 bytes parent folder | download | duplicates (7)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*-
use strict;
use warnings FATAL => 'all';

use Apache::TestRequest qw(GET_BODY_ASSERT);
use Apache::Test;
use Apache::TestUtil;

my $module = 'TestModperl::setupenv';
my $url    = Apache::TestRequest::module2url($module);

t_debug("connecting to $url");

my @locations = ("${url}_mpdefault",
                 "${url}_mpsetup",
                 "${url}_mpdefault",  # make sure %ENV is cleared
                 "${url}_mpvoid",
                 "${url}_mpsetupvoid",
                 "${url}_psdefault",
                 "${url}_psnosetup",
                 "${url}_psvoid",
                 "${url}_psnosetupvoid");

# plan the tests from a handler so we can run
# tests from within handlers across multiple requests
#
# this requires keepalives and a per-connection interpreter
# to make certain we can plan in one request and test in another
# which requires LWP
unless (need_lwp() && need_module('mod_env')) {
    plan tests => 63, 0;
}

Apache::TestRequest::user_agent(keep_alive => 1);
print GET_BODY_ASSERT join '?', $url, scalar @locations;

# this tests for when %ENV is populated with CGI variables
# as well as the contents of the subprocess_env table
#
# see setupenv.pm for a full description of the tests

foreach my $location (@locations) {

    t_debug("trying $location");

    print GET_BODY_ASSERT $location;
}