From: Eric Wong Date: Fri, 29 Nov 2019 10:14:09 +0000 (+0000) Subject: t/common: set $0 when running script w/o fork X-Git-Tag: v1.3.0~243 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=48282c640eb4871f8fa07ea2ea06a2ef0e16535f;p=public-inbox.git t/common: set $0 when running script w/o fork 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!) --- 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); }