sub run_check
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($suffix, $test_name) = @_;
create_files();
# 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
#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.:
# target_session_attrs with multiple nodes.
sub test_target_session_attrs
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $node1 = shift;
my $node2 = shift;
my $target_node = shift;
# 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_master = shift;
# 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))
sub configure_and_reload
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($node, $parameter) = @_;
my $name = $node->name;