about summary refs log tree commit homepage
path: root/t/run.perl
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-09 07:09:35 -0100
committerEric Wong <e@80x24.org>2021-02-10 06:59:09 +0000
commitd5502546fd0c042069db4c91ccdf4af5547efe12 (patch)
treeef57ea66c89346f7a5f0a4c06d5b17654a116551 /t/run.perl
parent30e9ab9d119d28c2630446948d1d4446311e421d (diff)
downloadpublic-inbox-d5502546fd0c042069db4c91ccdf4af5547efe12.tar.gz
Perl 5.8.8/5.10.0+ can use fchdir(), and we depend on 5.10.1+
Diffstat (limited to 't/run.perl')
-rwxr-xr-xt/run.perl5
1 files changed, 2 insertions, 3 deletions
diff --git a/t/run.perl b/t/run.perl
index d0b29e68..e8512e18 100755
--- a/t/run.perl
+++ b/t/run.perl
@@ -14,7 +14,6 @@ use strict;
 use v5.10.1;
 use IO::Handle; # ->autoflush
 use PublicInbox::TestCommon;
-use Cwd qw(getcwd);
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 use Errno qw(EINTR);
 use Fcntl qw(:seek);
@@ -33,7 +32,7 @@ if (($ENV{TEST_RUN_MODE} // 2) == 0) {
         die "$0 is not compatible with TEST_RUN_MODE=0\n";
 }
 my @tests = scalar(@ARGV) ? @ARGV : glob('t/*.t');
-my $cwd = getcwd();
+open my $cwd_fh, '<', '.' or die "open .: $!";
 open my $OLDOUT, '>&STDOUT' or die "dup STDOUT: $!";
 open my $OLDERR, '>&STDERR' or die "dup STDERR: $!";
 $OLDOUT->autoflush(1);
@@ -64,7 +63,7 @@ our ($worker, $worker_test);
 sub test_status () {
         $? = 255 if $? == 0 && !$tb->is_passing;
         my $status = $? ? 'not ok' : 'ok';
-        chdir($cwd) or DIE "chdir($cwd): $!";
+        chdir($cwd_fh) or DIE "fchdir: $!";
         if ($log_suffix ne '') {
                 my $log = $worker_test;
                 $log =~ s/\.t\z/$log_suffix/;