From c4309f4aeeae54e4c5281d68e29288af1d0d1ed2 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 22 May 2018 14:25:01 -0400 Subject: 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 --- src/test/perl/PostgresNode.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/perl/PostgresNode.pm') 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; -- cgit v1.2.3