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 118FD1F4B4 for ; Sat, 17 Apr 2021 02:24:10 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [SQUASH] test_common: fix -C $DIR with TEST_RUN_MODE=0 Date: Fri, 16 Apr 2021 22:24:09 -0400 Message-Id: <20210417022409.81869-1-e@80x24.org> In-Reply-To: <20210416231035.31807-6-e@80x24.org> References: <20210416231035.31807-6-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- lib/PublicInbox/TestCommon.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 465d4b9d..2627871a 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -288,9 +288,12 @@ sub run_script ($;$$) { } if ($run_mode == 0) { # spawn an independent new process, like real-world use cases: - $spawn_opt->{$_} = $opt->{$_} for (qw(-C)); require PublicInbox::Spawn; my $cmd = [ key2script($key), @argv ]; + if (my $d = $opt->{'-C'}) { + $cmd->[0] = File::Spec->rel2abs($cmd->[0]); + $spawn_opt->{'-C'} = $d; + } my $pid = PublicInbox::Spawn::spawn($cmd, $env, $spawn_opt); if (defined $pid) { my $r = waitpid($pid, 0) // die "waitpid: $!";