about summary refs log tree commit
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-12-22 22:17:39 +0000
committerEric Wong <e@80x24.org>2019-12-24 03:48:12 +0000
commitcd8dd7b08fddc7c2b5f218c3fcaa5dca5f9ad945 (patch)
tree0989e4981be20e2408dda31314da019bd1841647 /t
parent9484944697a1bf76d00d84d081e6a7d633074336 (diff)
downloadpublic-inbox-cd8dd7b08fddc7c2b5f218c3fcaa5dca5f9ad945.tar.gz
Xapian upstream is slowly phasing out the XS-based Search::Xapian
in favor of the SWIG-generated "Xapian" package.  While Debian and
both FreeBSD have Search::Xapian, OpenBSD only includes the "Xapian"
binding.

More information about the status of the "Xapian" Perl module here:
https://trac.xapian.org/ticket/523
Diffstat (limited to 't')
-rw-r--r--t/indexlevels-mirror.t3
-rw-r--r--t/psgi_multipart_not.t2
-rw-r--r--t/psgi_search.t2
-rw-r--r--t/psgi_v2.t7
-rw-r--r--t/xcpdb-reshard.t4
5 files changed, 10 insertions, 8 deletions
diff --git a/t/indexlevels-mirror.t b/t/indexlevels-mirror.t
index e4313faa..2244870b 100644
--- a/t/indexlevels-mirror.t
+++ b/t/indexlevels-mirror.t
@@ -165,7 +165,8 @@ import_index_incremental($PI_TEST_VERSION, 'basic', $mime);
 
 SKIP: {
         require PublicInbox::Search;
-        PublicInbox::Search::load_xapian() or skip 'Search::Xapian missing', 2;
+        PublicInbox::Search::load_xapian() or
+                skip('Xapian perl binding missing', 2);
         foreach my $l (qw(medium full)) {
                 import_index_incremental($PI_TEST_VERSION, $l, $mime);
         }
diff --git a/t/psgi_multipart_not.t b/t/psgi_multipart_not.t
index fbc09f55..606151c4 100644
--- a/t/psgi_multipart_not.t
+++ b/t/psgi_multipart_not.t
@@ -10,7 +10,7 @@ use PublicInbox::TestCommon;
 my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common
               Plack::Test URI::Escape Plack::Builder Plack::Test);
 require_mods(@mods);
-use_ok($_) for @mods;
+use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
 use_ok 'PublicInbox::V2Writable';
 my ($repo, $for_destroy) = tmpdir();
 my $ibx = PublicInbox::Inbox->new({
diff --git a/t/psgi_search.t b/t/psgi_search.t
index 95749c66..534063f8 100644
--- a/t/psgi_search.t
+++ b/t/psgi_search.t
@@ -13,7 +13,7 @@ use PublicInbox::TestCommon;
 my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
                 URI::Escape Plack::Builder);
 require_mods(@mods);
-use_ok $_ foreach (@mods, qw(PublicInbox::SearchIdx));
+use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
 my ($tmpdir, $for_destroy) = tmpdir();
 
 my $ibx = PublicInbox::Inbox->new({
diff --git a/t/psgi_v2.t b/t/psgi_v2.t
index 9a81ee9a..a02b90fb 100644
--- a/t/psgi_v2.t
+++ b/t/psgi_v2.t
@@ -9,10 +9,9 @@ use PublicInbox::MIME;
 use PublicInbox::Config;
 use PublicInbox::WWW;
 use PublicInbox::MID qw(mids);
-my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
-                URI::Escape Plack::Builder);
-require_mods(@mods);
-use_ok($_) for @mods;
+require_mods(qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
+                URI::Escape Plack::Builder));
+use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
 use_ok 'PublicInbox::V2Writable';
 my ($inboxdir, $for_destroy) = tmpdir();
 my $ibx = {
diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t
index 1eae234d..2a0aeb45 100644
--- a/t/xcpdb-reshard.t
+++ b/t/xcpdb-reshard.t
@@ -8,6 +8,7 @@ require_mods(qw(DBD::SQLite Search::Xapian));
 require_git('2.6');
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
+use PublicInbox::Search;
 
 my $mime = PublicInbox::MIME->create(
         header => [
@@ -61,8 +62,9 @@ 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};
         foreach my $d (@new_shards) {
-                my $xdb = Search::Xapian::Database->new($d);
+                my $xdb = $XapianDatabase->new($d);
                 $tot += $xdb->get_doccount;
                 my $it = $xdb->postlist_begin('');
                 my $end = $xdb->postlist_end('');