From: Eric Wong Date: Sat, 14 May 2016 01:24:08 +0000 (+0000) Subject: t/nntpd: avoid fork+exec for search indexing X-Git-Tag: v1.0.0~548 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90e12e68de364f175d79508c96921891cb766ac7;p=thirdparty%2Fpublic-inbox.git t/nntpd: avoid fork+exec for search indexing 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. --- diff --git a/t/nntpd.t b/t/nntpd.t index a389a3e9f..a9df36dc7 100644 --- 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');