]> Sergey Matveev's repositories - public-inbox.git/commitdiff
tests: expand relative @INC paths
authorEric Wong <e@80x24.org>
Tue, 25 Oct 2022 11:43:18 +0000 (11:43 +0000)
committerEric Wong <e@80x24.org>
Tue, 25 Oct 2022 17:19:00 +0000 (17:19 +0000)
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

index abf4f3642b00c0fa57ef5163c8d2676cc6d35d53..e793a001e20e94a4cdce121155fd12bfaff9a84c 100644 (file)
@@ -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