aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-05-22 14:25:01 -0400
committerPeter Eisentraut <peter_e@gmx.net>2018-07-01 12:58:32 +0200
commitc4309f4aeeae54e4c5281d68e29288af1d0d1ed2 (patch)
tree706fa479aa19f3128ee71ef8c0884569204dd04a /src/test/perl/PostgresNode.pm
parent65782346a4812482bfb09f9e1117c908146e67b5 (diff)
downloadpostgresql-c4309f4aeeae54e4c5281d68e29288af1d0d1ed2.tar.gz
postgresql-c4309f4aeeae54e4c5281d68e29288af1d0d1ed2.zip
Use $Test::Builder::Level in TAP test functions
In TAP test functions, that is, those that produce test results, locally increment $Test::Builder::Level. This has the effect that test failures are reported at the callers location rather than somewhere in the test support libraries. Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 5f848a0db7a..a08af65695b 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1366,6 +1366,8 @@ PostgresNode.
sub command_ok
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $self = shift;
local $ENV{PGPORT} = $self->port;
@@ -1384,6 +1386,8 @@ TestLib::command_fails with our PGPORT. See command_ok(...)
sub command_fails
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $self = shift;
local $ENV{PGPORT} = $self->port;
@@ -1402,6 +1406,8 @@ TestLib::command_like with our PGPORT. See command_ok(...)
sub command_like
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $self = shift;
local $ENV{PGPORT} = $self->port;
@@ -1420,6 +1426,8 @@ TestLib::command_checks_all with our PGPORT. See command_ok(...)
sub command_checks_all
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $self = shift;
local $ENV{PGPORT} = $self->port;
@@ -1442,6 +1450,8 @@ The log file is truncated prior to running the command, however.
sub issues_sql_like
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($self, $cmd, $expected_sql, $test_name) = @_;
local $ENV{PGPORT} = $self->port;