unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] t/*.t: use identifiable tempdir names
@ 2016-03-03  9:07 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-03-03  9:07 UTC (permalink / raw)
  To: meta

This should make identifiying leftover directories
due to SIGKILL-ed tests easier.
---
 t/cgi.t          | 2 +-
 t/config.t       | 2 +-
 t/feed.t         | 2 +-
 t/git.t          | 2 +-
 t/html_index.t   | 2 +-
 t/httpd-corner.t | 2 +-
 t/httpd.t        | 2 +-
 t/init.t         | 2 +-
 t/mda.t          | 2 +-
 t/msgmap.t       | 2 +-
 t/nntpd.t        | 2 +-
 t/plack.t        | 2 +-
 t/search.t       | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/t/cgi.t b/t/cgi.t
index ebf1416..f1a2730 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -11,7 +11,7 @@ use IPC::Run qw/run/;
 use constant CGI => "blib/script/public-inbox.cgi";
 my $mda = "blib/script/public-inbox-mda";
 my $index = "blib/script/public-inbox-index";
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-cgi-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $pi_home = "$home/.public-inbox";
 my $pi_config = "$pi_home/config";
diff --git a/t/config.t b/t/config.t
index 88ed62a..48df087 100644
--- a/t/config.t
+++ b/t/config.t
@@ -5,7 +5,7 @@ use warnings;
 use Test::More;
 use PublicInbox::Config;
 use File::Temp qw/tempdir/;
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 
 {
 	is(system(qw(git init -q --bare), $tmpdir), 0, "git init successful");
diff --git a/t/feed.t b/t/feed.t
index 71cbb73..73b7d0b 100644
--- a/t/feed.t
+++ b/t/feed.t
@@ -15,7 +15,7 @@ sub string_feed {
 	stream_to_string(PublicInbox::Feed::generate($_[0]));
 }
 
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-feed-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/gittest";
 
 {
diff --git a/t/git.t b/t/git.t
index 19fbef1..0f3dbae 100644
--- a/t/git.t
+++ b/t/git.t
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use File::Temp qw/tempdir/;
-my $dir = tempdir(CLEANUP => 1);
+my $dir = tempdir('pi-git-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 use Cwd qw/getcwd/;
 
 use_ok 'PublicInbox::Git';
diff --git a/t/html_index.t b/t/html_index.t
index 50f5ae5..adbadaf 100644
--- a/t/html_index.t
+++ b/t/html_index.t
@@ -6,7 +6,7 @@ use Test::More;
 use Email::Simple;
 use PublicInbox::Feed;
 use File::Temp qw/tempdir/;
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-http-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/gittest";
 
 # setup
diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index 4069208..e73ebd5 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -19,7 +19,7 @@ use IO::Socket;
 use Fcntl qw(FD_CLOEXEC F_SETFD F_GETFD :seek);
 use Socket qw(SO_KEEPALIVE IPPROTO_TCP TCP_NODELAY);
 use POSIX qw(dup2 mkfifo :sys_wait_h);
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('httpd-corner-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $fifo = "$tmpdir/fifo";
 ok(defined mkfifo($fifo, 0777), 'created FIFO');
 my $err = "$tmpdir/stderr.log";
diff --git a/t/httpd.t b/t/httpd.t
index ad636fc..25b4f41 100644
--- a/t/httpd.t
+++ b/t/httpd.t
@@ -17,7 +17,7 @@ use Socket qw(SO_KEEPALIVE IPPROTO_TCP TCP_NODELAY);
 use IPC::Run;
 
 # FIXME: too much setup
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-httpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
diff --git a/t/init.t b/t/init.t
index 8989557..b78fbaf 100644
--- a/t/init.t
+++ b/t/init.t
@@ -5,7 +5,7 @@ use warnings;
 use Test::More;
 use PublicInbox::Config;
 use File::Temp qw/tempdir/;
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-init-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 use constant pi_init => 'blib/script/public-inbox-init';
 
 {
diff --git a/t/mda.t b/t/mda.t
index a8e78b3..03bad87 100644
--- a/t/mda.t
+++ b/t/mda.t
@@ -11,7 +11,7 @@ use IPC::Run qw(run);
 
 my $mda = "blib/script/public-inbox-mda";
 my $learn = "blib/script/public-inbox-learn";
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-mda-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $pi_home = "$home/.public-inbox";
 my $pi_config = "$pi_home/config";
diff --git a/t/msgmap.t b/t/msgmap.t
index 6a4f4f8..5c28e54 100644
--- a/t/msgmap.t
+++ b/t/msgmap.t
@@ -11,7 +11,7 @@ foreach my $mod (qw(DBD::SQLite)) {
 }
 
 use_ok 'PublicInbox::Msgmap';
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-msgmap-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $d = PublicInbox::Msgmap->new($tmpdir, 1);
 
 my %mid2num;
diff --git a/t/nntpd.t b/t/nntpd.t
index d8c2e7b..d597855 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -18,7 +18,7 @@ use File::Temp qw/tempdir/;
 use Net::NNTP;
 use IPC::Run qw(run);
 
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
diff --git a/t/plack.t b/t/plack.t
index b77cdba..568f09f 100644
--- a/t/plack.t
+++ b/t/plack.t
@@ -9,7 +9,7 @@ use Cwd;
 use IPC::Run qw/run/;
 my $psgi = "examples/public-inbox.psgi";
 my $mda = "blib/script/public-inbox-mda";
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-plack-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $pi_home = "$home/.public-inbox";
 my $pi_config = "$pi_home/config";
diff --git a/t/search.t b/t/search.t
index df5a5d3..bbf1a89 100644
--- a/t/search.t
+++ b/t/search.t
@@ -7,7 +7,7 @@ eval { require PublicInbox::SearchIdx; };
 plan skip_all => "Xapian missing for search" if $@;
 use File::Temp qw/tempdir/;
 use Email::MIME;
-my $tmpdir = tempdir(CLEANUP => 1);
+my $tmpdir = tempdir('pi-search-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/a.git";
 my ($root_id, $last_id);
 
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-03  9:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03  9:07 [PATCH] t/*.t: use identifiable tempdir names Eric Wong

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).