summaryrefslogtreecommitdiffstats
path: root/t/001compile.t
diff options
context:
space:
mode:
Diffstat (limited to 't/001compile.t')
-rw-r--r--t/001compile.t45
1 files changed, 28 insertions, 17 deletions
diff --git a/t/001compile.t b/t/001compile.t
index f8ba8d1c7..a2176babd 100644
--- a/t/001compile.t
+++ b/t/001compile.t
@@ -1,31 +1,41 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+# -*- Mode: perl; indent-tabs-mode: nil -*-
#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code are the Bugzilla Tests.
+#
+# The Initial Developer of the Original Code is Zach Lipton
+# Portions created by Zach Lipton are Copyright (C) 2001 Zach Lipton.
+# All Rights Reserved.
+#
+# Contributor(s): Zach Lipton <zach@zachlipton.com>
+# Max Kanat-Alexander <mkanat@bugzilla.org>
#################
#Bugzilla Test 1#
###Compilation###
-use 5.10.1;
use strict;
-use warnings;
-
-use lib qw(. lib local/lib/perl5 t);
+use 5.008001;
+use lib qw(. lib t);
use Config;
use Support::Files;
-use Test::More tests => scalar(@Support::Files::testitems)
- + scalar(@Support::Files::test_files);
+use Test::More tests => scalar(@Support::Files::testitems);
BEGIN {
use_ok('Bugzilla::Constants');
use_ok('Bugzilla::Install::Requirements');
use_ok('Bugzilla');
}
-Bugzilla->usage_mode(USAGE_MODE_TEST);
sub compile_file {
my ($file) = @_;
@@ -55,12 +65,12 @@ sub compile_file {
$T = "T";
}
- my $libs = '-It ';
+ my $libs = '';
if ($ENV{PERL5LIB}) {
- $libs .= join " ", map { "-I\"$_\"" } split /$Config{path_sep}/, $ENV{PERL5LIB};
+ $libs = join " ", map { "-I\"$_\"" } split /$Config{path_sep}/, $ENV{PERL5LIB};
}
my $perl = qq{"$^X"};
- my $output = `$perl $libs -c$T -MSupport::Systemexec $file 2>&1`;
+ my $output = `$perl $libs -wc$T $file 2>&1`;
chomp($output);
my $return_val = $?;
$output =~ s/^\Q$file\E syntax OK$//ms;
@@ -68,7 +78,7 @@ sub compile_file {
ok(!$return_val, $file) or diag('--ERROR');
}
-my @testitems = (@Support::Files::testitems, @Support::Files::test_files);
+my @testitems = @Support::Files::testitems;
my $file_features = map_files_to_features();
# Test the scripts by compiling them
@@ -92,7 +102,8 @@ foreach my $file (@testitems) {
and $file ne "Bugzilla/DB/Schema.pm")
{
my $module = lc($1);
- Bugzilla->feature($module) or skip "$file: Driver for $module not installed", 1;
+ my $dbd = DB_MODULE->{$module}->{dbd}->{module};
+ eval("use $dbd; 1") or skip "$file: $dbd not installed", 1;
}
compile_file($file);