* [PATCH 09/11] t/run.perl: drop Cwd dependency
2021-02-09 8:09 6% [PATCH 00/11] Maildir code consolidation, test updates Eric Wong
@ 2021-02-09 8:09 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-02-09 8:09 UTC (permalink / raw)
To: meta
Perl 5.8.8/5.10.0+ can use fchdir(), and we depend on 5.10.1+
---
t/run.perl | 5 ++---
1 file 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/;
^ permalink raw reply related [relevance 7%]
* [PATCH 00/11] Maildir code consolidation, test updates
@ 2021-02-09 8:09 6% Eric Wong
2021-02-09 8:09 7% ` [PATCH 09/11] t/run.perl: drop Cwd dependency Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-02-09 8:09 UTC (permalink / raw)
To: meta
MdirReader is the home of Maildir-related code, and
-watch is updated to use some of it, as is the
InboxWritable->import_maildir (which I'm not sure
should live).
"lei q --alert=" is slightly changed for CLI-friendliness
tr/-/:/
And damn, I just misread "Cwd" as "Covid"; /me goes back
to hiding under the bed :<
Eric Wong (11):
t/thread-index-gap.t: avoid unnecessary map
test_common: disable fsync on the command-line where possible
t/cgi.t: modernizations and style updates
git: ->qx: respect caller's $/ in array context
lei: split out MdirReader package, lazy-require earlier
t/run.perl: fix for >128 tests
use MdirReader in -watch and InboxWritable
lei q: prefix --alert ops with ':' instead of '-'
t/run.perl: drop Cwd dependency
lei: replace "I:"-prefixed info messages with "#"
tests: (lei) fixes for TEST_RUN_MODE=0 and oneshot mode
MANIFEST | 2 +
lib/PublicInbox/Git.pm | 1 -
lib/PublicInbox/IPC.pm | 2 +
lib/PublicInbox/Import.pm | 6 +--
lib/PublicInbox/InboxWritable.pm | 55 +++++++++------------
lib/PublicInbox/LEI.pm | 21 ++++----
lib/PublicInbox/LeiImport.pm | 25 ++++++----
lib/PublicInbox/LeiOverview.pm | 2 +-
lib/PublicInbox/LeiToMail.pm | 26 ++++------
lib/PublicInbox/MdirReader.pm | 39 +++++++++++++++
lib/PublicInbox/TestCommon.pm | 10 +++-
lib/PublicInbox/Watch.pm | 6 ++-
t/cgi.t | 84 +++++++++++++-------------------
t/lei-import.t | 5 +-
t/lei-mirror.t | 2 +-
t/lei.t | 2 +-
t/lei_to_mail.t | 19 ++++++--
t/mdir_reader.t | 22 +++++++++
t/run.perl | 22 ++++-----
t/thread-index-gap.t | 10 ++--
20 files changed, 211 insertions(+), 150 deletions(-)
create mode 100644 lib/PublicInbox/MdirReader.pm
create mode 100644 t/mdir_reader.t
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-02-09 8:09 6% [PATCH 00/11] Maildir code consolidation, test updates Eric Wong
2021-02-09 8:09 7% ` [PATCH 09/11] t/run.perl: drop Cwd dependency Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).