~ubuntu-branches/ubuntu/edgy/libapache2-mod-perl2/edgy

« back to all changes in this revision

Viewing changes to Apache-Test/lib/Apache/TestConfigPerl.pm

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2004-08-19 06:23:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040819062348-jxl4koqbtvgm8v2t
Tags: 1.99.14-4
Remove the LFS CFLAGS, and build-dep against apache2-*-dev (>= 2.0.50-10)
as we're backing out of the apache2/apr ABI transition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2001-2004 The Apache Software Foundation
 
2
#
 
3
# Licensed under the Apache License, Version 2.0 (the "License");
 
4
# you may not use this file except in compliance with the License.
 
5
# You may obtain a copy of the License at
 
6
#
 
7
#     http://www.apache.org/licenses/LICENSE-2.0
 
8
#
 
9
# Unless required by applicable law or agreed to in writing, software
 
10
# distributed under the License is distributed on an "AS IS" BASIS,
 
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
12
# See the License for the specific language governing permissions and
 
13
# limitations under the License.
 
14
#
1
15
package Apache::TestConfig; #not TestConfigPerl on purpose
2
16
 
3
17
#things specific to mod_perl
79
93
        $cfg = "#$msg";
80
94
        debug $msg;
81
95
    }
82
 
    $self->preamble(IfModule => '!mod_perl.c', $cfg);
 
96
 
 
97
    # modules like Embperl.so need mod_perl.so to be loaded first,
 
98
    # so make sure that it's loaded before files inherited from the
 
99
    # global httpd.conf
 
100
    $self->preamble_first(IfModule => '!mod_perl.c', $cfg);
 
101
 
83
102
}
84
103
 
85
104
sub configure_inc {
109
128
}
110
129
 
111
130
sub write_pm_test {
112
 
    my($self, $module, $base, $sub) = @_;
 
131
    my($self, $module, $sub, @base) = @_;
113
132
 
114
 
    my $dir = catfile $self->{vars}->{t_dir}, $base;
 
133
    my $dir = catfile $self->{vars}->{t_dir}, @base;
115
134
    my $t = catfile $dir, "$sub.t";
116
135
    return if -e $t;
117
136
 
161
180
        my $include_pl = catfile $self->{vars}->{t_conf}, 'modperl_inc.pl';
162
181
        my $fh = $self->genfile($include_pl);
163
182
        for (reverse @$inc) {
 
183
            next unless $_;
164
184
            print $fh "use lib '$_';\n";
165
185
        }
166
186
        my $fixup = Apache::TestConfig->modperl_2_inc_fixup();
207
227
sub set_connection_handler {
208
228
    my($self, $module, $args) = @_;
209
229
    my $port = $self->new_vhost($module);
210
 
    $self->postamble(Listen => $port);
 
230
    my $vars = $self->{vars};
 
231
    $self->postamble(Listen => '0.0.0.0:' . $port);
211
232
}
212
233
 
213
234
my %add_hook_config = (
465
486
sub configure_pm_tests {
466
487
    my $self = shift;
467
488
 
468
 
    # since server wasn't started yet, the modules in blib under
469
 
    # Apache2 can't be seen. So we must load Apache2.pm, without which
470
 
    # run_apache_test_config might fail to require modules
471
 
    require mod_perl;
472
 
    if ($mod_perl::VERSION > 1.99) {
473
 
        require Apache2;
474
 
    }
475
 
 
476
489
    my @entries = ();
477
490
    $self->configure_pm_tests_pick(\@entries);
478
491
    $self->configure_pm_tests_sort(\@entries);
488
501
 
489
502
        $self->run_apache_test_configure($file, $module, $status);
490
503
 
491
 
        my($base, $sub) =
 
504
        my @base =
492
505
            map { s/^test//i; $_ } split '::', $module;
493
506
 
 
507
        my $sub = pop @base;
 
508
 
494
509
        my $hook = ($subdir eq 'Hooks' ? $hooks{$sub} : '')
495
510
            || $hooks{$subdir} || $subdir;
496
511
 
531
546
            $self->postamble($self->$container($module), \@args) if @args;
532
547
        }
533
548
 
534
 
        $self->write_pm_test($module, lc $base, lc $sub);
 
549
        $self->write_pm_test($module, lc $sub, map { lc } @base);
535
550
    }
536
551
}
537
552