Revision cc849a74
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
t/001compile.t | ||
---|---|---|
74 | 74 |
if (-l $file) { |
75 | 75 |
ok(1, "$file is a symlink"); |
76 | 76 |
} else { |
77 |
local $TODO; |
|
78 |
$TODO = 'schema updates are not required to be strict now' if $file =~ m{^sql/Pg-upgrade2}; |
|
79 |
|
|
80 |
my $command = "$perlapp -c$T -I modules/fallback -I modules/override $file 2>&1"; |
|
77 |
my $command = "$perlapp -w -c$T -Imodules/fallback -Imodules/override -It -MSupport::CanonialGlobals $file 2>&1"; |
|
81 | 78 |
my $loginfo=`$command`; |
82 | 79 |
|
83 | 80 |
if ($loginfo =~ /syntax ok$/im) { |
t/Support/CanonialGlobals.pm | ||
---|---|---|
1 |
package Support::CanonialGlobals; |
|
2 |
|
|
3 |
my @globals = qw( |
|
4 |
$::lxdebug |
|
5 |
$::auth |
|
6 |
%::myconfig |
|
7 |
$::form |
|
8 |
%::lx_office_conf |
|
9 |
$::locale |
|
10 |
$::dispatcher |
|
11 |
$::instance_conf |
|
12 |
%::request |
|
13 |
); |
|
14 |
|
|
15 |
sub import { |
|
16 |
eval "$_" for @globals; |
|
17 |
} |
t/structure/globals.t | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
use lib 't'; |
5 | 5 |
use Support::Files; |
6 |
use Support::CanonialGlobals (); |
|
6 | 7 |
|
7 | 8 |
my (@globals, $testcount); |
8 | 9 |
|
9 | 10 |
BEGIN { |
10 |
@globals = qw(lxdebug auth myconfig form lx_office_conf locale dispatcher instance_conf request);
|
|
11 |
@globals = map { s/[^a-z_]//; $_ } @Support::CanonialGlobals::globals;
|
|
11 | 12 |
$testcount = scalar(@Support::Files::testitems); |
12 | 13 |
} |
13 | 14 |
|
Auch abrufbar als: Unified diff
globale Variablen in ein Helfermodul ausgelagert