aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/TestLib.pm
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-03-26 22:24:13 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-03-27 08:18:22 -0400
commitfacde2a98f0b5f7689b4e30a9e7376e926e733b8 (patch)
treeab8b2cc1b2bd47b7db5e2def26d8eca4ce6ca438 /src/test/perl/TestLib.pm
parentde4da168d57de812bb30d359394b7913635d21a9 (diff)
downloadpostgresql-facde2a98f0b5f7689b4e30a9e7376e926e733b8.tar.gz
postgresql-facde2a98f0b5f7689b4e30a9e7376e926e733b8.zip
Clean up Perl code according to perlcritic
Fix all perlcritic warnings of severity level 5, except in src/backend/utils/Gen_dummy_probes.pl, which is automatically generated. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Diffstat (limited to 'src/test/perl/TestLib.pm')
-rw-r--r--src/test/perl/TestLib.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index d22957ceb0e..ae8d1782da7 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -84,14 +84,14 @@ INIT
$test_logfile = basename($0);
$test_logfile =~ s/\.[^.]+$//;
$test_logfile = "$log_path/regress_log_$test_logfile";
- open TESTLOG, '>', $test_logfile
+ open my $testlog, '>', $test_logfile
or die "could not open STDOUT to logfile \"$test_logfile\": $!";
# Hijack STDOUT and STDERR to the log file
- open(ORIG_STDOUT, ">&STDOUT");
- open(ORIG_STDERR, ">&STDERR");
- open(STDOUT, ">&TESTLOG");
- open(STDERR, ">&TESTLOG");
+ open(my $orig_stdout, '>&', \*STDOUT);
+ open(my $orig_stderr, '>&', \*STDERR);
+ open(STDOUT, '>&', $testlog);
+ open(STDERR, '>&', $testlog);
# The test output (ok ...) needs to be printed to the original STDOUT so
# that the 'prove' program can parse it, and display it to the user in
@@ -99,16 +99,16 @@ INIT
# in the log.
my $builder = Test::More->builder;
my $fh = $builder->output;
- tie *$fh, "SimpleTee", *ORIG_STDOUT, *TESTLOG;
+ tie *$fh, "SimpleTee", $orig_stdout, $testlog;
$fh = $builder->failure_output;
- tie *$fh, "SimpleTee", *ORIG_STDERR, *TESTLOG;
+ tie *$fh, "SimpleTee", $orig_stderr, $testlog;
# Enable auto-flushing for all the file handles. Stderr and stdout are
# redirected to the same file, and buffering causes the lines to appear
# in the log in confusing order.
autoflush STDOUT 1;
autoflush STDERR 1;
- autoflush TESTLOG 1;
+ autoflush $testlog 1;
}
END