summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-05-27 05:07:35 +0200
committermkanat%kerio.com <>2005-05-27 05:07:35 +0200
commit31985208f02a64aed42d915663504ba2eefd6bcf (patch)
treea694ec419c9a65a982d3bd46c66675cb4fd0348d
parent8656d28056f2bf697e549f44ba8cf82382e1409b (diff)
downloadbugzilla-31985208f02a64aed42d915663504ba2eefd6bcf.tar.gz
bugzilla-31985208f02a64aed42d915663504ba2eefd6bcf.tar.xz
Bug 286701: Tests fail compiling Bugzilla::DB::Pg.pm
Patch By Colin Ogilvie <colin.ogilvie@gmail.com> r=mkanat, a=justdave
-rw-r--r--t/001compile.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/001compile.t b/t/001compile.t
index 303724848..5ea849ac1 100644
--- a/t/001compile.t
+++ b/t/001compile.t
@@ -32,6 +32,10 @@ use Support::Files;
use Test::More tests => scalar(@Support::Files::testitems);
+# Need this to get the available driver information
+use DBI;
+my @DBI_drivers = DBI->available_drivers;
+
# Bugzilla requires Perl 5.6.1 now. Checksetup will tell you this if you run it, but
# it tests it in a polite/passive way that won't make it fail at compile time. We'll
# slip in a compile-time failure if it's missing here so a tinderbox on 5.00503 won't
@@ -60,6 +64,16 @@ my $perlapp = "\"$^X\"";
foreach my $file (@testitems) {
$file =~ s/\s.*$//; # nuke everything after the first space (#comment)
next if (!$file); # skip null entries
+
+ # Check that we have a DBI module to support the DB, if this is a database
+ # module (but not Schema)
+ if ($file =~ m#Bugzilla/DB/([^/]+)\.pm$# && $file ne "Bugzilla/DB/Schema.pm") {
+ if (!grep(lc($_) =~ /$1/i, @DBI_drivers)) {
+ ok(1,$file." - Skipping, as the DBD module not installed");
+ next;
+ }
+ }
+
open (FILE,$file);
my $bang = <FILE>;
close (FILE);