summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/kerberos/t/001_auth.pl2
-rw-r--r--src/test/perl/README10
-rw-r--r--src/test/recovery/t/001_stream_rep.pl2
-rw-r--r--src/test/recovery/t/003_recovery_targets.pl2
-rw-r--r--src/test/recovery/t/007_sync_rep.pl2
-rw-r--r--src/test/recovery/t/009_twophase.pl2
-rw-r--r--src/test/recovery/t/018_wal_optimize.pl2
7 files changed, 21 insertions, 1 deletions
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index c484237d078..968be3952f4 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -221,6 +221,8 @@ sub test_access
# As above, but test for an arbitrary query result.
sub test_query
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($node, $role, $query, $expected, $gssencmode, $test_name) = @_;
# need to connect over TCP/IP for Kerberos
diff --git a/src/test/perl/README b/src/test/perl/README
index 67a050b9d48..b2a5541557b 100644
--- a/src/test/perl/README
+++ b/src/test/perl/README
@@ -61,9 +61,17 @@ Test::More::like entails use of the qr// operator. Avoid Perl 5.8.8 bug
#39185 by not using the "$" regular expression metacharacter in qr// when also
using the "/m" modifier. Instead of "$", use "\n" or "(?=\n|\z)".
-Read the Test::More documentation for more on how to write tests:
+Test::Builder::Level controls how far up in the call stack a test will look
+at when reporting a failure. This should be incremented by any subroutine
+which directly or indirectly calls test routines from Test::More, such as
+ok() or is():
+
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
+Read the documentation for more on how to write tests:
perldoc Test::More
+ perldoc Test::Builder
For available PostgreSQL-specific test methods and some example tests read the
perldoc for the test modules, e.g.:
diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl
index ac581c1c078..9916a36012c 100644
--- a/src/test/recovery/t/001_stream_rep.pl
+++ b/src/test/recovery/t/001_stream_rep.pl
@@ -75,6 +75,8 @@ note "testing connection parameter \"target_session_attrs\"";
# Expect to connect to $target_node (undef for failure) with given $status.
sub test_target_session_attrs
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $node1 = shift;
my $node2 = shift;
my $target_node = shift;
diff --git a/src/test/recovery/t/003_recovery_targets.pl b/src/test/recovery/t/003_recovery_targets.pl
index 7bd500ed956..78ef60d3b2d 100644
--- a/src/test/recovery/t/003_recovery_targets.pl
+++ b/src/test/recovery/t/003_recovery_targets.pl
@@ -14,6 +14,8 @@ use Time::HiRes qw(usleep);
# count to reach $num_rows, yet not later than the recovery target.
sub test_recovery_standby
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $test_name = shift;
my $node_name = shift;
my $node_primary = shift;
diff --git a/src/test/recovery/t/007_sync_rep.pl b/src/test/recovery/t/007_sync_rep.pl
index 9d00e17f9f0..3b031addf76 100644
--- a/src/test/recovery/t/007_sync_rep.pl
+++ b/src/test/recovery/t/007_sync_rep.pl
@@ -17,6 +17,8 @@ my $check_sql =
# the configuration file is reloaded before the test.
sub test_sync_state
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($self, $expected, $msg, $setting) = @_;
if (defined($setting))
diff --git a/src/test/recovery/t/009_twophase.pl b/src/test/recovery/t/009_twophase.pl
index 78d4ef5b54b..66a256208c4 100644
--- a/src/test/recovery/t/009_twophase.pl
+++ b/src/test/recovery/t/009_twophase.pl
@@ -14,6 +14,8 @@ my $psql_rc = '';
sub configure_and_reload
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($node, $parameter) = @_;
my $name = $node->name;
diff --git a/src/test/recovery/t/018_wal_optimize.pl b/src/test/recovery/t/018_wal_optimize.pl
index 47cbc959554..3bedeffcae1 100644
--- a/src/test/recovery/t/018_wal_optimize.pl
+++ b/src/test/recovery/t/018_wal_optimize.pl
@@ -18,6 +18,8 @@ use Test::More tests => 38;
sub check_orphan_relfilenodes
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($node, $test_name) = @_;
my $db_oid = $node->safe_psql('postgres',