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

« back to all changes in this revision

Viewing changes to ModPerl-Registry/t/cgi-bin/perlrun_extload.pl

  • 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
use warnings;
 
2
use strict;
 
3
 
 
4
use Apache::Test ();
 
5
use Apache::TestUtil;
 
6
use File::Spec::Functions qw(catfile catdir);
 
7
 
 
8
use lib catdir Apache::Test::vars('serverroot'), 'cgi-bin';
 
9
my $require = catfile Apache::Test::vars('serverroot'),
 
10
    qw(cgi-bin perlrun_nondecl.pl);
 
11
 
 
12
print "Content-type: text/plain\n\n";
 
13
 
 
14
### declared package module ###
 
15
{
 
16
    # require a module w/ package declaration (it doesn't get reloaded
 
17
    # because it declares the package). But we still have a problem with
 
18
    # subs declaring prototypes. When perlrun_decl->import is called, the
 
19
    # original function's prototype doesn't match the aliases prototype.
 
20
    # see decl_proto()
 
21
    BEGIN { t_server_log_warn_is_expected()
 
22
                if perlrun_decl->can("decl_proto"); 
 
23
    }
 
24
    use perlrun_decl;
 
25
 
 
26
    die "perlrun_decl BEGIN block was run more than once"
 
27
        if $MyData::blocks{perlrun_decl} > 1;
 
28
 
 
29
    print "d";
 
30
    print decl_proto(1);
 
31
}
 
32
 
 
33
### non-declared package module ###
 
34
{
 
35
    # how many times were were called from the same interpreter
 
36
    $MyData::blocks{cycle}{perlrun_nondecl}++;
 
37
    $MyData::blocks{BEGIN}{perlrun_nondecl} ||= 0;
 
38
    $MyData::blocks{END}  {perlrun_nondecl} ||= 0;
 
39
 
 
40
    # require a lib w/o package declaration. Functions in that lib get
 
41
    # automatically aliased to the functions in the current package.
 
42
    require "$require";
 
43
 
 
44
    die "perlrun_nondecl's BEGIN block wasn't run"
 
45
        if $MyData::blocks{BEGIN}{perlrun_nondecl} !=
 
46
           $MyData::blocks{cycle}{perlrun_nondecl};
 
47
 
 
48
    # the END block for this cycle didn't run yet, but we can test the
 
49
    # previous cycle's one
 
50
    die "perlrun_nondecl's END block wasn't run"
 
51
        if $MyData::blocks{END}{perlrun_nondecl} + 1 !=
 
52
           $MyData::blocks{cycle}{perlrun_nondecl};
 
53
 
 
54
    # they all get redefined warning inside perlrun_nondecl.pl, since that
 
55
    # lib loads it into main::, vs. PerlRun undefs the current __PACKAGE__
 
56
    print "nd";
 
57
    print nondecl_no_proto();
 
58
    print nondecl_proto(2);
 
59
    print nondecl_proto_empty("whatever");
 
60
    print nondecl_const();
 
61
}