Skip to content

Commit

Permalink
Fail test if TMPDIR is not writable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel Horne committed Oct 5, 2020
1 parent 4aae6c8 commit 6eb6f0d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -17,6 +17,7 @@ t/coverage.t
t/critic.t
t/cv.t
t/dist.t
t/eol.t
t/gv.t
t/is_cached.t
t/js.t
Expand Down
7 changes: 7 additions & 0 deletions Makefile.PL
@@ -1,6 +1,13 @@
use strict;
use warnings;
use ExtUtils::MakeMaker 6.64; # 6.64 for TEST_REQUIRES
use File::Spec 3.4;

my $tmpdir = File::Spec->tmpdir();
if(!-w $tmpdir) {
print STDERR "NA: Your temporary directory '$tmpdir' isn't writable, fix your configuration and try again";
exit(0);
}

WriteMakefile(
NAME => 'CGI::Buffer',
Expand Down
20 changes: 20 additions & 0 deletions t/eol.t
@@ -0,0 +1,20 @@
use strict;
use warnings;

use Test::Most;

BEGIN {
if($ENV{AUTHOR_TESTING}) {
eval {
require Test::EOL;
};
if($@) {
plan(skip_all => 'Test::EOL not installed');
} else {
import Test::EOL;
all_perl_files_ok({ trailing_whitespace => 1 });
}
} else {
plan(skip_all => 'Author tests not required for installation');
}
}
2 changes: 1 addition & 1 deletion t/js.t
Expand Up @@ -26,7 +26,7 @@ OUTPUT: {
use CGI::Buffer;
CGI::Buffer::set_options(optimise_content => 2);
print "Content-type: text/html; charset=ISO=8859-1";
print "\n\n";
Expand Down

0 comments on commit 6eb6f0d

Please sign in to comment.