From c0db9b2cff514144e4f5cb04d1c88b167778c6fc Mon Sep 17 00:00:00 2001 From: Andrew Hewus Fresh Date: Thu, 17 Sep 2026 17:41:36 -0700 Subject: [PATCH] Allow tests in readonly source directory In the OpenBSD source tree we build without permission to make changes to the src dir, this lets the tests pass in that case. --- t/pod/pod2usage.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/pod/pod2usage.t b/t/pod/pod2usage.t index e1aea85..6754099 100644 --- a/t/pod/pod2usage.t +++ b/t/pod/pod2usage.t @@ -5,8 +5,10 @@ use Test::More tests => 1; use File::Basename; use File::Spec; +use File::Temp; use Cwd qw(abs_path); my $THISDIR; +my $TMPDIR = File::Temp->newdir(basename(__FILE__) . '-XXXXXXXXX'); BEGIN { $THISDIR = dirname(abs_path(__FILE__)); unshift @INC, $THISDIR; @@ -18,7 +20,7 @@ use Pod::Text; my $infile = File::Spec->catfile($THISDIR, (File::Spec->updir) x 2, 'scripts', 'pod2usage.PL'); my $cmpfile = File::Spec->catfile($THISDIR, 'pod2usage.xr'); -my $outfile = File::Spec->catfile($THISDIR, 'pod2usage.OUT'); +my $outfile = File::Spec->catfile($TMPDIR, 'pod2usage.OUT'); my $text_parser = Pod::Text->new; $text_parser->parse_from_file($infile, $outfile);