File: load.t

package info (click to toggle)
libapache-asp-perl 2.62-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 4,108 kB
  • ctags: 830
  • sloc: perl: 6,033; php: 417; sh: 65; lisp: 22; makefile: 10
file content (29 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (4)
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
use Apache::ASP::CGI;
use lib '.'; use lib qw(t); use T; my $t = T->new();

use Carp;
chdir('t');

$SIG{__DIE__} = \&Carp::confess;
$main::TestLoad = 0;
Apache::ASP->Loader('load.inc', undef, Debug => 1, Execute => 1);
$t->eok($main::TestLoad, "failed to execute load.inc while loading");

my $error_mark;
{	
    # Apache::ASP->Loader() uses warn() aliased to Apache::ASP::Warn() to put out error messages
    $^W = 0;
    local *Apache::ASP::Warn = sub {
	my $log_output = join("", @_);
	if($log_output =~ /not_scoped_variable/is) {
	    $error_mark = $log_output;
	} else {
	    warn(@_);
	}
    };
    $^W = 1;
  Apache::ASP->Loader('load_error.inc', undef, Debug => 1, UseStrict => 1);
}
$t->eok($error_mark, "failed to catch compile error of load_error.inc while loading");

$t->done;