File: all.t

package info (click to toggle)
libapache2-mod-perl2 2.0.9~1624218-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 11,840 kB
  • sloc: perl: 95,064; ansic: 14,522; makefile: 49; sh: 18
file content (41 lines) | stat: -rw-r--r-- 919 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
use strict;
use warnings FATAL => 'all';

use Config;
use Apache::Test;

# skip all tests in this directory unless mod_perl is enabled
plan tests => 1, \&my_need;

ok 1;

sub my_need {

    my $ok = 1;

    if ( $Config{'osname'} eq 'linux' ) {
        $ok = need_module('Linux::Pid');
        if ( -e '/proc/self/smaps' ) {
            $ok &= need_module('Linux::Smaps');
        }
    }
    elsif ( $Config{'osname'} =~ /(bsd|aix)/i ) {
        $ok &= need_module('BSD::Resource');
    }
    elsif ( $Config{'osname'} eq 'MSWin32' ) {
        $ok &= need_module('Win32::API');
    }
    elsif ( $Config{'osname'} eq 'darwin' ) {
        push @Apache::Test::SkipReasons,
            "$Config{osname} is not supported - broken getrusage(3)";
        return 0;
    }

    $ok &= need_module('mod_perl.c');

    $ok &= need_apache(1);

    $ok &= need_min_module_version('Test::Builder' => '0.18_01');

    return $ok;
}