]> granicus.if.org Git - postgresql/commitdiff
Remove use of TAP subtests
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 29 Oct 2014 23:41:19 +0000 (19:41 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 29 Oct 2014 23:43:51 +0000 (19:43 -0400)
They turned out to be too much of a portability headache, because they
need a fairly new version of Test::More to work properly.

21 files changed:
src/bin/initdb/t/001_initdb.pl
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_basebackup/t/020_pg_receivexlog.pl
src/bin/pg_config/t/001_pg_config.pl
src/bin/pg_controldata/t/001_pg_controldata.pl
src/bin/pg_ctl/t/001_start_stop.pl
src/bin/scripts/t/010_clusterdb.pl
src/bin/scripts/t/011_clusterdb_all.pl
src/bin/scripts/t/020_createdb.pl
src/bin/scripts/t/030_createlang.pl
src/bin/scripts/t/040_createuser.pl
src/bin/scripts/t/050_dropdb.pl
src/bin/scripts/t/060_droplang.pl
src/bin/scripts/t/070_dropuser.pl
src/bin/scripts/t/080_pg_isready.pl
src/bin/scripts/t/090_reindexdb.pl
src/bin/scripts/t/091_reindexdb_all.pl
src/bin/scripts/t/100_vacuumdb.pl
src/bin/scripts/t/101_vacuumdb_all.pl
src/bin/scripts/t/102_vacuumdb_stages.pl
src/test/perl/TestLib.pm

index db92a88a4e161edb7536a66720dfa404c6b7b9ca..149b3d1bb393656eb567d52eee2fc7aab1fc52dd 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 14;
+use Test::More tests => 19;
 
 my $tempdir = TestLib::tempdir;
 
index 597fb60a528066141870cda44a531f59766aa04d..fa2627b267d85b4baa38b890dc29abe3dea100dc 100644 (file)
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 use Cwd;
 use TestLib;
-use Test::More tests => 28;
+use Test::More tests => 33;
 
 program_help_ok('pg_basebackup');
 program_version_ok('pg_basebackup');
index 700ae045a199e39f0844764550d21f4ad52a8957..c68e86d91206e7911c07c886e524cef6eb90b1ea 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 3;
+use Test::More tests => 8;
 
 program_help_ok('pg_receivexlog');
 program_version_ok('pg_receivexlog');
index c911798dbc4a618af45929807aa3673b17fb2b7d..ccca190bb19b5c6320a250c53e5ff921cde4718a 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 7;
+use Test::More tests => 20;
 
 program_help_ok('pg_config');
 program_version_ok('pg_config');
index 35ad10a25cee9381fb440de32fea208469654055..a4180e7ed18a50b6f0467955daf7f8c579448162 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 6;
+use Test::More tests => 13;
 
 my $tempdir = TestLib::tempdir;
 
index 79f5db71b268c404a426a25c05738d45efc8fefc..61dfab77eb3ecfb81e3fd1985054ea06458aebdc 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 10;
+use Test::More tests => 15;
 
 my $tempdir = TestLib::tempdir;
 my $tempdir_short = TestLib::tempdir_short;
index fe22cdbb4e4e86c544b5d8e27e1c45b58f963da0..cb9d04b0fe6bdeb67dc6e95d109d79814c871d0a 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 6;
+use Test::More tests => 13;
 
 program_help_ok('clusterdb');
 program_version_ok('clusterdb');
index eb2016497e314772f4481b4605440eb489cbc94c..7769f70bb153ed7be4a4ded9550b6b04204783c8 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 my $tempdir = tempdir;
 start_test_server $tempdir;
index a8e8f3b4d12f806fd2cd3016c4be427205de99ee..40fbc9278d03192c99a1e91bf16468a377d640cc 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 6;
+use Test::More tests => 13;
 
 program_help_ok('createdb');
 program_version_ok('createdb');
index 292021611b6144e4efd3be017a300d1f450ea290..7ff0a3ed38d2ce43533275401d3e295284c17fad 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 6;
+use Test::More tests => 14;
 
 program_help_ok('createlang');
 program_version_ok('createlang');
index 8837c2b6e99707aa93b7d7b74958be10aa83710d..4d44e14b7cf2d4a51e0ef78d700667fad471d68b 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 8;
+use Test::More tests => 17;
 
 program_help_ok('createuser');
 program_version_ok('createuser');
index 04a8789d8874f7efea2d3aad058ee98d341d09bb..3065e5051df77b8f20196c69be86985c61a2c2db 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 5;
+use Test::More tests => 11;
 
 program_help_ok('dropdb');
 program_version_ok('dropdb');
index 09fb2f3b07747448addb2e0c31c65301a4e1a755..6a21d7e33d8cea1da7d260661ac5b7e013a67da9 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 5;
+use Test::More tests => 11;
 
 program_help_ok('droplang');
 program_version_ok('droplang');
index 9e0587d68f9637549f15e462ad1048934f9d12bf..bbb3b7922a46620b21fcb24daab92540b74d689f 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 5;
+use Test::More tests => 11;
 
 program_help_ok('dropuser');
 program_version_ok('dropuser');
index 03c3657153f2d61fa3c23d65f3f807e8c4f8beee..f432505d5cd390a549351244a0c6665ea8864aae 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 5;
+use Test::More tests => 10;
 
 program_help_ok('pg_isready');
 program_version_ok('pg_isready');
index 24b927ce223558535b3e5cccca1a589b84c6417a..d5b42dee034fe3a7d61a8049a384ad2cfd7f3905 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 7;
+use Test::More tests => 16;
 
 program_help_ok('reindexdb');
 program_version_ok('reindexdb');
index 6c5c59e749299622a939488676b7735faabc5272..ffadf29bc65679467fa2f6a8a9a99a38ca69c123 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 my $tempdir = tempdir;
 start_test_server $tempdir;
index 78a40fa791a017f6ebd5dd62da334477248cb218..d6555f5fef43286fdcab7619f7b198775ac2b56f 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 8;
+use Test::More tests => 18;
 
 program_help_ok('vacuumdb');
 program_version_ok('vacuumdb');
index f2120e0bff3d7dce957fdbde4a2fca1f969f5cd5..e90f321d1eb92fb805a64159876bc28af8a14393 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 my $tempdir = tempdir;
 start_test_server $tempdir;
index 18d596ea548274357cf0f1c77011959b00a10b80..1ff05e3c27c8b987f831d71080256754ea51cc4a 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use TestLib;
-use Test::More tests => 2;
+use Test::More tests => 4;
 
 my $tempdir = tempdir;
 start_test_server $tempdir;
index fa8e67d0040c983758a44762c7d2501d9a626f2a..cdb5e31c362516ea553622cc212501040a7840e8 100644 (file)
@@ -37,21 +37,6 @@ BEGIN
        {
                plan skip_all => "IPC::Run not available";
        };
-
-       eval {
-               Test::More->VERSION('0.93_01');
-       } or do
-       {
-               plan skip_all => "version of Test::More is too old to support subplans";
-       };
-
-       eval {
-               require Test::Simple;
-               Test::Simple->VERSION('0.98');
-       } or do
-       {
-               plan skip_all => "version of Test::Simple is too old to support subplans properly";
-       };
 }
 
 # Set to untranslated messages, to be able to compare program output
@@ -180,67 +165,51 @@ sub command_exit_is
 sub program_help_ok
 {
        my ($cmd) = @_;
-       subtest "$cmd --help" => sub {
-               plan tests => 3;
-               my ($stdout, $stderr);
-               my $result = run [ $cmd, '--help' ], '>', \$stdout, '2>', \$stderr;
-               ok($result, "$cmd --help exit code 0");
-               isnt($stdout, '', "$cmd --help goes to stdout");
-               is($stderr, '', "$cmd --help nothing to stderr");
-       };
+       my ($stdout, $stderr);
+       my $result = run [ $cmd, '--help' ], '>', \$stdout, '2>', \$stderr;
+       ok($result, "$cmd --help exit code 0");
+       isnt($stdout, '', "$cmd --help goes to stdout");
+       is($stderr, '', "$cmd --help nothing to stderr");
 }
 
 sub program_version_ok
 {
        my ($cmd) = @_;
-       subtest "$cmd --version" => sub {
-               plan tests => 3;
-               my ($stdout, $stderr);
-               my $result = run [ $cmd, '--version' ], '>', \$stdout, '2>', \$stderr;
-               ok($result, "$cmd --version exit code 0");
-               isnt($stdout, '', "$cmd --version goes to stdout");
-               is($stderr, '', "$cmd --version nothing to stderr");
-       };
+       my ($stdout, $stderr);
+       my $result = run [ $cmd, '--version' ], '>', \$stdout, '2>', \$stderr;
+       ok($result, "$cmd --version exit code 0");
+       isnt($stdout, '', "$cmd --version goes to stdout");
+       is($stderr, '', "$cmd --version nothing to stderr");
 }
 
 sub program_options_handling_ok
 {
        my ($cmd) = @_;
-       subtest "$cmd options handling" => sub {
-               plan tests => 2;
-               my ($stdout, $stderr);
-               my $result = run [ $cmd, '--not-a-valid-option' ], '>', \$stdout,
-                 '2>', \$stderr;
-               ok(!$result, "$cmd with invalid option nonzero exit code");
-               isnt($stderr, '', "$cmd with invalid option prints error message");
-       };
+       my ($stdout, $stderr);
+       my $result = run [ $cmd, '--not-a-valid-option' ], '>', \$stdout, '2>', \$stderr;
+       ok(!$result, "$cmd with invalid option nonzero exit code");
+       isnt($stderr, '', "$cmd with invalid option prints error message");
 }
 
 sub command_like
 {
        my ($cmd, $expected_stdout, $test_name) = @_;
-       subtest $test_name => sub {
-               plan tests => 3;
-               my ($stdout, $stderr);
-               my $result = run $cmd, '>', \$stdout, '2>', \$stderr;
-               ok($result, "@$cmd exit code 0");
-               is($stderr, '', "@$cmd no stderr");
-               like($stdout, $expected_stdout, "$test_name: matches");
-       };
+       my ($stdout, $stderr);
+       my $result = run $cmd, '>', \$stdout, '2>', \$stderr;
+       ok($result, "@$cmd exit code 0");
+       is($stderr, '', "@$cmd no stderr");
+       like($stdout, $expected_stdout, "$test_name: matches");
 }
 
 sub issues_sql_like
 {
        my ($cmd, $expected_sql, $test_name) = @_;
-       subtest $test_name => sub {
-               plan tests => 2;
-               my ($stdout, $stderr);
-               truncate $test_server_logfile, 0;
-               my $result = run $cmd, '>', \$stdout, '2>', \$stderr;
-               ok($result, "@$cmd exit code 0");
-               my $log = `cat '$test_server_logfile'`;
-               like($log, $expected_sql, "$test_name: SQL found in server log");
-       };
+       my ($stdout, $stderr);
+       truncate $test_server_logfile, 0;
+       my $result = run $cmd, '>', \$stdout, '2>', \$stderr;
+       ok($result, "@$cmd exit code 0");
+       my $log = `cat '$test_server_logfile'`;
+       like($log, $expected_sql, "$test_name: SQL found in server log");
 }
 
 1;