From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id DFA5B1F5C0 for ; Fri, 15 Nov 2019 09:51:04 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 22/29] t/httpd: use run_script for -init Date: Fri, 15 Nov 2019 09:50:53 +0000 Message-Id: <20191115095100.25633-23-e@80x24.org> In-Reply-To: <20191115095100.25633-1-e@80x24.org> References: <20191115095100.25633-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This only gives a small ~10% speedup, since -httpd still needs execve, but any speedup is welcome. --- t/httpd.t | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/t/httpd.t b/t/httpd.t index 15984a78..e7527ed6 100644 --- a/t/httpd.t +++ b/t/httpd.t @@ -22,7 +22,6 @@ my $group = 'test-httpd'; my $addr = $group . '@example.com'; my $cfgpfx = "publicinbox.$group"; my $httpd = 'blib/script/public-inbox-httpd'; -my $init = 'blib/script/public-inbox-init'; my $sock = tcp_server(); my $pid; use_ok 'PublicInbox::Git'; @@ -31,8 +30,8 @@ use_ok 'Email::MIME'; END { kill 'TERM', $pid if defined $pid }; { local $ENV{HOME} = $home; - ok(!system($init, $group, $maindir, 'http://example.com/', $addr), - 'init ran properly'); + my $cmd = [ '-init', $group, $maindir, 'http://example.com/', $addr ]; + ok(run_script($cmd), 'init ran properly'); # ensure successful message delivery { @@ -53,7 +52,7 @@ EOF $im->done($mime); } ok($sock, 'sock created'); - my $cmd = [ $httpd, '-W0', "--stdout=$out", "--stderr=$err" ]; + $cmd = [ $httpd, '-W0', "--stdout=$out", "--stderr=$err" ]; $pid = spawn_listener(undef, $cmd, [$sock]); my $host = $sock->sockhost; my $port = $sock->sockport;