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 6A8221F466 for ; Fri, 29 Nov 2019 10:14:14 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/7] t/common: set $0 when running script w/o fork Date: Fri, 29 Nov 2019 10:14:09 +0000 Message-Id: <20191129101414.343-3-e@80x24.org> In-Reply-To: <20191129101414.343-1-e@80x24.org> References: <20191129101414.343-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can localize changes to $0 so $0 is restored when the "script" sub is done. This will be helpful when we encounter a stuck/slow processes during our tests (hopefully never!) --- t/common.perl | 1 + 1 file changed, 1 insertion(+) diff --git a/t/common.perl b/t/common.perl index 0ff5de4a..288a0a19 100644 --- a/t/common.perl +++ b/t/common.perl @@ -171,6 +171,7 @@ sub run_script ($;$$) { local *STDERR = *STDERR; local %ENV = $env ? (%ENV, %$env) : %ENV; local %SIG = %SIG; + local $0 = join(' ', @$cmd); _prepare_redirects($fhref); _run_sub($sub, $key, \@argv); }