Skip to content

Commit

Permalink
Update build to accommodate older test harness and EUMM setting $^W
Browse files Browse the repository at this point in the history
  • Loading branch information
genio committed Oct 8, 2018
1 parent 510777f commit 845373a
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Revision history File::Slurp

9999.20_03 2018-10-04 (TRIAL)
-
- Unset $^W in a few strategic places to silence warnings when Test::Harness
or ExtUtils::MakeMaker turn them on. (Thanks, Graham Knop).

9999.20_02 2018-10-04 (TRIAL)
- Update TravisCI tests to show coverage.
Expand Down
4 changes: 4 additions & 0 deletions t/01-error_prepend_file.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ use Test::More;

plan tests => 27;

# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;

# prepend_file reads in a file, edits the contents, writes the new file
# atomically to "foo.$$" then renames "foo.$$" to the original "foo"
# this leaves many failure steps to tend to
Expand Down
5 changes: 5 additions & 0 deletions t/binmode.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ BEGIN {
plan skip_all => 'Older Perl lacking unicode support' if $] < 5.008001;
}

# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;


plan tests => 4;

my $suf = 'utf8';
Expand Down
3 changes: 3 additions & 0 deletions t/error.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ use Test::More;
plan tests => 30;

my $is_win32 = $^O =~ /cygwin|win32/i ;
# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;

# write_file open error - no sysopen
{
Expand Down
4 changes: 4 additions & 0 deletions t/large.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ use File::Slurp;
use File::Temp qw(tempfile);
use Test::More;

# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;

my @text_data = (
[],
[ 'a' x 8 ],
Expand Down
6 changes: 5 additions & 1 deletion t/lib/FileSlurpTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ sub IS_WSL() {
sub temp_file_path {
my ($pick_nonsense_path) = @_;

# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;

my $file;
if ($pick_nonsense_path) {
$file = File::Spec->catfile(File::Spec->tmpdir, 'super', 'bad', 'file-spec', 'path');
$file = File::Spec->catfile(File::Spec->tmpdir, 'super', 'bad', 'file-slurp', 'path');
}
else {
(undef, $file) = tempfile('tempXXXXX', DIR => File::Spec->tmpdir, OPEN => 0);
Expand Down
4 changes: 4 additions & 0 deletions t/lib/FileSlurpTestOverride.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package FileSlurpTestOverride;

use Exporter qw(import);

# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;

BEGIN {
*CORE::GLOBAL::rename = sub($$) { my ($o, $n) = @_; CORE::rename($o, $n) };
# we only use the 4-arg version of syswrite
Expand Down
4 changes: 4 additions & 0 deletions t/original.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ use Test::More;

plan(tests => 8);

# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;

my (undef, $tmp) = tempfile('tempXXXXX', DIR => File::Spec->tmpdir, OPEN => 0);

my $short = <<END;
Expand Down
4 changes: 4 additions & 0 deletions t/stringify.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ use File::Temp qw(tempfile);
use IO::Handle ();
use Test::More;

# older EUMMs turn this on. We don't want to emit warnings.
# also, some of our CORE function overrides emit warnings. Silence those.
local $^W;

# this code creates the object which has a stringified path
{
package FileObject;
Expand Down

0 comments on commit 845373a

Please sign in to comment.