From: Eric Wong Date: Wed, 22 May 2019 02:14:01 +0000 (+0000) Subject: t/search*: require DBI and DBD::SQLite, too X-Git-Tag: v1.2.0~265 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5a14109dadc1e4d38402dc75cdf5af714864ba33;p=public-inbox.git t/search*: require DBI and DBD::SQLite, too None of the Search::Xapian-dependent stuff works without DBI and DBD::SQLite. There are no plans to support Xapian w/o DBD::SQLite since SQLite is more common and less resource-intensive than Xapian. --- diff --git a/t/search-thr-index.t b/t/search-thr-index.t index 848dc564..1872af84 100644 --- a/t/search-thr-index.t +++ b/t/search-thr-index.t @@ -7,8 +7,11 @@ use Test::More; use File::Temp qw/tempdir/; use PublicInbox::MID qw(mids); use Email::MIME; -eval { require Search::Xapian }; -plan skip_all => "Search::Xapian missing for search" if $@; +my @mods = qw(DBI DBD::SQLite Search::Xapian); +foreach my $mod (@mods) { + eval "require $mod"; + plan skip_all => "missing $mod for $0" if $@; +} require PublicInbox::SearchIdx; my $tmpdir = tempdir('pi-search-thr-index.XXXXXX', TMPDIR => 1, CLEANUP => 1); my $git_dir = "$tmpdir/a.git"; diff --git a/t/search.t b/t/search.t index a9d0c920..c063620c 100644 --- a/t/search.t +++ b/t/search.t @@ -3,8 +3,11 @@ use strict; use warnings; use Test::More; -eval { require Search::Xapian }; -plan skip_all => "Search::Xapian missing for search" if $@; +my @mods = qw(DBI DBD::SQLite Search::Xapian); +foreach my $mod (@mods) { + eval "require $mod"; + plan skip_all => "missing $mod for $0" if $@; +}; require PublicInbox::SearchIdx; use File::Temp qw/tempdir/; use Email::MIME;