]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/nntpd: avoid fork+exec for search indexing
authorEric Wong <e@80x24.org>
Sat, 14 May 2016 01:24:08 +0000 (01:24 +0000)
committerEric Wong <e@80x24.org>
Sat, 14 May 2016 01:24:08 +0000 (01:24 +0000)
The Xapian search index is required for the NNTP server, so
there's no point in calling system() for it like we do in
other tests.  This should speed up the test a small amount.

t/nntpd.t

index a389a3e9f46e7b592020359e7f1c5cfa93330750..a9df36dc7818764767e48bd5bb996745885b2a1a 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -27,7 +27,6 @@ my $addr = $group . '@example.com';
 my $cfgpfx = "publicinbox.$group";
 my $nntpd = 'blib/script/public-inbox-nntpd';
 my $init = 'blib/script/public-inbox-init';
-my $index = 'blib/script/public-inbox-index';
 use_ok 'PublicInbox::Import';
 use_ok 'PublicInbox::Git';
 
@@ -65,7 +64,8 @@ EOF
                my $im = PublicInbox::Import->new($git, 'test', $addr);
                $im->add($mime);
                $im->done;
-               is(0, system($index, $maindir), 'indexed git dir');
+               my $s = PublicInbox::SearchIdx->new($maindir, 1);
+               $s->index_sync;
        }
 
        ok($sock, 'sock created');