From faf88f9e2acd39055e882d420b42e1300a639c2b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 25 Oct 2022 11:43:18 +0000 Subject: [PATCH] tests: expand relative @INC paths Since the lei-daemon may chdir around and lazy-loads package, we must ensure @INC uses absolute paths so it can find stuff after (f)chdir. I noticed this in running `perl -I lib -w t/lei-q-kw.t' instead of my usual `prove -bvw t/lei-q-kw.t' to save some cycles. --- lib/PublicInbox/TestCommon.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index abf4f364..e793a001 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -14,6 +14,9 @@ our @EXPORT; my $lei_loud = $ENV{TEST_LEI_ERR_LOUD}; my $tail_cmd = $ENV{TAIL}; our ($lei_opt, $lei_out, $lei_err, $lei_cwdfh); + +$_ = File::Spec->rel2abs($_) for (grep(!m!^/!, @INC)); + BEGIN { @EXPORT = qw(tmpdir tcp_server tcp_connect require_git require_mods run_script start_script key2sub xsys xsys_e xqx eml_load tick -- 2.44.0