From 5e76c9b79f8dd42c2ac989d8c67341637fe00553 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 15 Nov 2019 09:50:53 +0000 Subject: t/httpd: use run_script for -init 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(-) (limited to 't') 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; -- cgit v1.2.3-24-ge0c7