about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-13 13:15:40 +0000
committerEric Wong <e@80x24.org>2023-11-13 21:54:59 +0000
commitc560ab9e67476ce7b4438f8323d8ae9e775e790e (patch)
tree9ecaf00583506df226a746df54af4375cc36861e /t
parent09f486cfa17019ad742853e3158ae4a5f580180c (diff)
downloadpublic-inbox-c560ab9e67476ce7b4438f8323d8ae9e775e790e.tar.gz
No need to suffer through an extra dose of slow Perl load times
when we can drive the build in the big parent Perl process and
get the executable path name to pass to spawn directly.
Diffstat (limited to 't')
-rw-r--r--t/xap_helper.t22
1 files changed, 9 insertions, 13 deletions
diff --git a/t/xap_helper.t b/t/xap_helper.t
index 7890392d..83f59d7d 100644
--- a/t/xap_helper.t
+++ b/t/xap_helper.t
@@ -61,11 +61,11 @@ my $doreq = sub {
 
 my $env = { PERL5LIB => join(':', @INC) };
 my $test = sub {
-        my (@arg) = @_;
+        my (@cmd) = @_;
         socketpair(my $s, my $y, AF_UNIX, SOCK_SEQPACKET, 0);
-        my $pid = spawn([$^X, '-w', @arg], $env, { 0 => $y });
+        my $pid = spawn(\@cmd, $env, { 0 => $y });
         my $ar = PublicInbox::AutoReap->new($pid);
-        diag "$arg[-1] running pid=$pid";
+        diag "$cmd[-1] running pid=$pid";
         close $y;
         my $r = $doreq->($s, qw(test_inspect -d), $ibx_idx[0]);
         my %info = map { split(/=/, $_, 2) } split(/ /, do { local $/; <$r> });
@@ -141,24 +141,20 @@ my $test = sub {
 
 my @NO_CXX = (1);
 unless ($ENV{TEST_XH_CXX_ONLY}) {
-        my $ar = $test->(qw[-MPublicInbox::XapHelper -e
+        my $ar = $test->($^X, qw[-w -MPublicInbox::XapHelper -e
                         PublicInbox::XapHelper::start('-j0')]);
-        ($ar, my $s) = $test->(qw[-MPublicInbox::XapHelper -e
+        ($ar, my $s) = $test->($^X, qw[-w -MPublicInbox::XapHelper -e
                         PublicInbox::XapHelper::start('-j1')]);
         no_pollerfd($ar->{pid});
 }
 SKIP: {
-        eval {
-                require PublicInbox::XapHelperCxx;
-                PublicInbox::XapHelperCxx::check_build();
-        };
+        require PublicInbox::XapHelperCxx;
+        my $cmd = eval { PublicInbox::XapHelperCxx::cmd() };
         skip "XapHelperCxx build: $@", 1 if $@ || $ENV{PI_NO_CXX};
 
         @NO_CXX = $ENV{TEST_XH_CXX_ONLY} ? (0) : (0, 1);
-        my $ar = $test->(qw[-MPublicInbox::XapHelperCxx -e
-                        PublicInbox::XapHelperCxx::start('-j0')]);
-        $ar = $test->(qw[-MPublicInbox::XapHelperCxx -e
-                        PublicInbox::XapHelperCxx::start('-j1')]);
+        my $ar = $test->(@$cmd, '-j0');
+        $ar = $test->(@$cmd, '-j1');
 };
 
 require PublicInbox::CodeSearch;