From cb850caf867e3e6920233c1c1ab7120cac054af8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 4 Jan 2020 21:37:52 +0000 Subject: tests: fix running without SQLite or Xapian PublicInbox::Search always loads DBD::SQLite, so we can't blindly "use" it in t/xcpdb-reshard.t. We also need to account for that in TestCommon. --- t/xcpdb-reshard.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t index 2a0aeb45..9f0034f1 100644 --- a/t/xcpdb-reshard.t +++ b/t/xcpdb-reshard.t @@ -8,7 +8,7 @@ require_mods(qw(DBD::SQLite Search::Xapian)); require_git('2.6'); use PublicInbox::MIME; use PublicInbox::InboxWritable; -use PublicInbox::Search; +require PublicInbox::Search; my $mime = PublicInbox::MIME->create( header => [ @@ -62,7 +62,10 @@ for my $R (qw(2 4 1 3 3)) { # ensure docids in Xapian match NNTP article numbers my $tot = 0; my %tmp = %nums; - my $XapianDatabase = $PublicInbox::Search::X{Database}; + my $XapianDatabase = do { + no warnings 'once'; + $PublicInbox::Search::X{Database}; + }; foreach my $d (@new_shards) { my $xdb = $XapianDatabase->new($d); $tot += $xdb->get_doccount; -- cgit v1.2.3-24-ge0c7