From cc849a74f2a5ff51b8a0f8224f2cadc2f63acd56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 20 Jun 2013 18:40:54 +0200 Subject: [PATCH] globale Variablen in ein Helfermodul ausgelagert --- t/001compile.t | 5 +---- t/Support/CanonialGlobals.pm | 17 +++++++++++++++++ t/structure/globals.t | 3 ++- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 t/Support/CanonialGlobals.pm diff --git a/t/001compile.t b/t/001compile.t index 6b814abfc..5289a2d28 100644 --- a/t/001compile.t +++ b/t/001compile.t @@ -74,10 +74,7 @@ foreach my $file (@testitems) { if (-l $file) { ok(1, "$file is a symlink"); } else { - local $TODO; - $TODO = 'schema updates are not required to be strict now' if $file =~ m{^sql/Pg-upgrade2}; - - my $command = "$perlapp -c$T -I modules/fallback -I modules/override $file 2>&1"; + my $command = "$perlapp -w -c$T -Imodules/fallback -Imodules/override -It -MSupport::CanonialGlobals $file 2>&1"; my $loginfo=`$command`; if ($loginfo =~ /syntax ok$/im) { diff --git a/t/Support/CanonialGlobals.pm b/t/Support/CanonialGlobals.pm new file mode 100644 index 000000000..0dec37fde --- /dev/null +++ b/t/Support/CanonialGlobals.pm @@ -0,0 +1,17 @@ +package Support::CanonialGlobals; + +my @globals = qw( + $::lxdebug + $::auth + %::myconfig + $::form + %::lx_office_conf + $::locale + $::dispatcher + $::instance_conf + %::request +); + +sub import { + eval "$_" for @globals; +} diff --git a/t/structure/globals.t b/t/structure/globals.t index 0a04c6f6f..dca7369d5 100644 --- a/t/structure/globals.t +++ b/t/structure/globals.t @@ -3,11 +3,12 @@ use strict; use lib 't'; use Support::Files; +use Support::CanonialGlobals (); my (@globals, $testcount); BEGIN { - @globals = qw(lxdebug auth myconfig form lx_office_conf locale dispatcher instance_conf request); + @globals = map { s/[^a-z_]//; $_ } @Support::CanonialGlobals::globals; $testcount = scalar(@Support::Files::testitems); } -- 2.20.1