summaryrefslogtreecommitdiff
path: root/src/test/perl
diff options
context:
space:
mode:
authorDaniel Gustafsson2022-02-11 19:54:44 +0000
committerDaniel Gustafsson2022-02-11 19:54:44 +0000
commit549ec201d6132b7c7ee11ee90a4e02119259ba5b (patch)
tree44c1669ef24c66233c16b2fa77aff148596f67a7 /src/test/perl
parent751b8d23b788580bbff7463e3959f9a92a95b28a (diff)
Replace Test::More plans with done_testing
Rather than doing manual book keeping to plan the number of tests to run in each TAP suite, conclude each run with done_testing() summing up the the number of tests that ran. This removes the need for maintaning and updating the plan count at the expense of an accurate count of remaining during the test suite runtime. This patch has been discussed a number of times, often in the context of other patches which updates tests, so a larger number of discussions can be found in the archives. Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/DD399313-3D56-4666-8079-88949DAC870F@yesql.se
Diffstat (limited to 'src/test/perl')
-rw-r--r--src/test/perl/README7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/perl/README b/src/test/perl/README
index 9e870830cf..0511c55e9a 100644
--- a/src/test/perl/README
+++ b/src/test/perl/README
@@ -54,8 +54,7 @@ Each test script should begin with:
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
- # Replace with the number of tests to execute:
- use Test::More tests => 1;
+ use Test::More;
then it will generally need to set up one or more nodes, run commands
against them and evaluate the results. For example:
@@ -69,6 +68,10 @@ against them and evaluate the results. For example:
$node->stop('fast');
+Each test script should end with:
+
+ done_testing();
+
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)".