Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 549ec20

Browse files
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 <[email protected]> Reviewed-by: Dagfinn Ilmari Mannsåker <[email protected]> Reviewed-by: Tom Lane <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Reviewed-by: Kyotaro Horiguchi <[email protected]> Discussion: https://postgr.es/m/[email protected]
1 parent 751b8d2 commit 549ec20

File tree

139 files changed

+394
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+394
-303
lines changed

contrib/amcheck/t/001_verify_heapam.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use PostgreSQL::Test::Utils;
99

1010
use Fcntl qw(:seek);
11-
use Test::More tests => 272;
11+
use Test::More;
1212

1313
my ($node, $result);
1414

@@ -283,3 +283,5 @@ sub check_all_options_uncorrupted
283283
}
284284
}
285285
}
286+
287+
done_testing();

contrib/amcheck/t/002_cic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use PostgreSQL::Test::Cluster;
1010
use PostgreSQL::Test::Utils;
1111

12-
use Test::More tests => 3;
12+
use Test::More;
1313

1414
my ($node, $result);
1515

contrib/amcheck/t/003_cic_2pc.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use PostgreSQL::Test::Cluster;
1010
use PostgreSQL::Test::Utils;
1111

12-
use Test::More tests => 5;
12+
use Test::More;
1313

1414
Test::More->builder->todo_start('filesystem bug')
1515
if PostgreSQL::Test::Utils::has_wal_read_bug;

contrib/auto_explain/t/001_auto_explain.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use PostgreSQL::Test::Cluster;
88
use PostgreSQL::Test::Utils;
9-
use Test::More tests => 4;
9+
use Test::More;
1010

1111
my $node = PostgreSQL::Test::Cluster->new('main');
1212
$node->init;
@@ -53,3 +53,5 @@
5353
$log_contents,
5454
qr/"Node Type": "Index Scan"[^}]*"Index Name": "pg_class_relname_nsp_index"/s,
5555
"index scan logged, json mode");
56+
57+
done_testing();

contrib/bloom/t/001_wal.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use warnings;
77
use PostgreSQL::Test::Cluster;
88
use PostgreSQL::Test::Utils;
9-
use Test::More tests => 31;
9+
use Test::More;
1010

1111
my $node_primary;
1212
my $node_standby;
@@ -80,3 +80,5 @@ sub test_index_replay
8080
);
8181
test_index_replay("insert $i");
8282
}
83+
84+
done_testing();

contrib/oid2name/t/001_basic.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
use warnings;
66

77
use PostgreSQL::Test::Utils;
8-
use Test::More tests => 8;
8+
use Test::More;
99

1010
#########################################
1111
# Basic checks
1212

1313
program_help_ok('oid2name');
1414
program_version_ok('oid2name');
1515
program_options_handling_ok('oid2name');
16+
17+
done_testing();

contrib/test_decoding/t/001_repl_stats.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use File::Path qw(rmtree);
99
use PostgreSQL::Test::Cluster;
1010
use PostgreSQL::Test::Utils;
11-
use Test::More tests => 2;
11+
use Test::More;
1212

1313
# Test set-up
1414
my $node = PostgreSQL::Test::Cluster->new('test');
@@ -118,3 +118,5 @@ sub test_slot_stats
118118

119119
# shutdown
120120
$node->stop;
121+
122+
done_testing();

contrib/vacuumlo/t/001_basic.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
use warnings;
66

77
use PostgreSQL::Test::Utils;
8-
use Test::More tests => 8;
8+
use Test::More;
99

1010
program_help_ok('vacuumlo');
1111
program_version_ok('vacuumlo');
1212
program_options_handling_ok('vacuumlo');
13+
14+
done_testing();

src/bin/initdb/t/001_initdb.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use File::stat qw{lstat};
1212
use PostgreSQL::Test::Cluster;
1313
use PostgreSQL::Test::Utils;
14-
use Test::More tests => 22;
14+
use Test::More;
1515

1616
my $tempdir = PostgreSQL::Test::Utils::tempdir;
1717
my $xlogdir = "$tempdir/pgxlog";
@@ -92,3 +92,5 @@
9292
ok(check_mode_recursive($datadir_group, 0750, 0640),
9393
'check PGDATA permissions');
9494
}
95+
96+
done_testing();

src/bin/pg_amcheck/t/001_basic.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
use warnings;
66

77
use PostgreSQL::Test::Utils;
8-
use Test::More tests => 8;
8+
use Test::More;
99

1010
program_help_ok('pg_amcheck');
1111
program_version_ok('pg_amcheck');
1212
program_options_handling_ok('pg_amcheck');
13+
14+
done_testing();

0 commit comments

Comments
 (0)