about summary refs log tree commit homepage
path: root/lib/PublicInbox/TestCommon.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-10-25 11:43:18 +0000
committerEric Wong <e@80x24.org>2022-10-25 17:19:00 +0000
commitfaf88f9e2acd39055e882d420b42e1300a639c2b (patch)
treeb8d0529f4e03ec70c6a761351897c77284c762ab /lib/PublicInbox/TestCommon.pm
parent1e7dc8e02310ec7f9056cd606ac8435b317ed92d (diff)
downloadpublic-inbox-faf88f9e2acd39055e882d420b42e1300a639c2b.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r--lib/PublicInbox/TestCommon.pm3
1 files changed, 3 insertions, 0 deletions
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