diff options
| author | Andrew Dunstan | 2021-10-24 14:28:19 +0000 |
|---|---|---|
| committer | Andrew Dunstan | 2021-10-24 14:28:19 +0000 |
| commit | b3b4d8e68ae83f432f43f035c7eb481ef93e1583 (patch) | |
| tree | ff4e73500b61f2235bd4e3822d8e1a1af3a37523 /src/bin/scripts | |
| parent | 3cd9c3b921977272e6650a5efbeade4203c4bca2 (diff) | |
Move Perl test modules to a better namespace
The five modules in our TAP test framework all had names in the top
level namespace. This is unwise because, even though we're not
exporting them to CPAN, the names can leak, for example if they are
exported by the RPM build process. We therefore move the modules to the
PostgreSQL::Test namespace. In the process PostgresNode is renamed to
Cluster, and TestLib is renamed to Utils. PostgresVersion becomes simply
PostgreSQL::Version, to avoid possible confusion about what it's the
version of.
Discussion: https://postgr.es/m/aede93a4-7d92-ef26-398f-5094944c2504@dunslane.net
Reviewed by Erik Rijkers and Michael Paquier
Diffstat (limited to 'src/bin/scripts')
| -rw-r--r-- | src/bin/scripts/t/010_clusterdb.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/011_clusterdb_all.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/020_createdb.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/040_createuser.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/050_dropdb.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/070_dropuser.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/080_pg_isready.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/090_reindexdb.pl | 8 | ||||
| -rw-r--r-- | src/bin/scripts/t/091_reindexdb_all.pl | 4 | ||||
| -rw-r--r-- | src/bin/scripts/t/100_vacuumdb.pl | 6 | ||||
| -rw-r--r-- | src/bin/scripts/t/101_vacuumdb_all.pl | 4 | ||||
| -rw-r--r-- | src/bin/scripts/t/102_vacuumdb_stages.pl | 4 | ||||
| -rw-r--r-- | src/bin/scripts/t/200_connstr.pl | 6 |
13 files changed, 37 insertions, 37 deletions
diff --git a/src/bin/scripts/t/010_clusterdb.pl b/src/bin/scripts/t/010_clusterdb.pl index aae5ea985b..0ba4aa4876 100644 --- a/src/bin/scripts/t/010_clusterdb.pl +++ b/src/bin/scripts/t/010_clusterdb.pl @@ -4,15 +4,15 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 14; program_help_ok('clusterdb'); program_version_ok('clusterdb'); program_options_handling_ok('clusterdb'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/011_clusterdb_all.pl b/src/bin/scripts/t/011_clusterdb_all.pl index 6ba71780de..d040b95cfb 100644 --- a/src/bin/scripts/t/011_clusterdb_all.pl +++ b/src/bin/scripts/t/011_clusterdb_all.pl @@ -4,11 +4,11 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 2; -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl index 3db2f13ae2..cb8e26c773 100644 --- a/src/bin/scripts/t/020_createdb.pl +++ b/src/bin/scripts/t/020_createdb.pl @@ -4,15 +4,15 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 22; program_help_ok('createdb'); program_version_ok('createdb'); program_options_handling_ok('createdb'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/040_createuser.pl b/src/bin/scripts/t/040_createuser.pl index 3da8b7ae75..a865c01f5a 100644 --- a/src/bin/scripts/t/040_createuser.pl +++ b/src/bin/scripts/t/040_createuser.pl @@ -4,15 +4,15 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 17; program_help_ok('createuser'); program_version_ok('createuser'); program_options_handling_ok('createuser'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/050_dropdb.pl b/src/bin/scripts/t/050_dropdb.pl index b9f0592bca..5c9342f290 100644 --- a/src/bin/scripts/t/050_dropdb.pl +++ b/src/bin/scripts/t/050_dropdb.pl @@ -4,15 +4,15 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 13; program_help_ok('dropdb'); program_version_ok('dropdb'); program_options_handling_ok('dropdb'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/070_dropuser.pl b/src/bin/scripts/t/070_dropuser.pl index 26dadaf4a5..5d6e75c903 100644 --- a/src/bin/scripts/t/070_dropuser.pl +++ b/src/bin/scripts/t/070_dropuser.pl @@ -4,15 +4,15 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 11; program_help_ok('dropuser'); program_version_ok('dropuser'); program_options_handling_ok('dropuser'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/080_pg_isready.pl b/src/bin/scripts/t/080_pg_isready.pl index 4f1184953e..42be32decc 100644 --- a/src/bin/scripts/t/080_pg_isready.pl +++ b/src/bin/scripts/t/080_pg_isready.pl @@ -4,8 +4,8 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 10; program_help_ok('pg_isready'); @@ -14,7 +14,7 @@ program_options_handling_ok('pg_isready'); command_fails(['pg_isready'], 'fails with no server running'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/090_reindexdb.pl b/src/bin/scripts/t/090_reindexdb.pl index 541504d8f0..5384b74ccd 100644 --- a/src/bin/scripts/t/090_reindexdb.pl +++ b/src/bin/scripts/t/090_reindexdb.pl @@ -4,15 +4,15 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 58; program_help_ok('reindexdb'); program_version_ok('reindexdb'); program_options_handling_ok('reindexdb'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; @@ -21,7 +21,7 @@ $ENV{PGOPTIONS} = '--client-min-messages=WARNING'; # Create a tablespace for testing. my $tbspace_path = $node->basedir . '/regress_reindex_tbspace'; mkdir $tbspace_path or die "cannot create directory $tbspace_path"; -$tbspace_path = TestLib::perl2host($tbspace_path); +$tbspace_path = PostgreSQL::Test::Utils::perl2host($tbspace_path); my $tbspace_name = 'reindex_tbspace'; $node->safe_psql('postgres', "CREATE TABLESPACE $tbspace_name LOCATION '$tbspace_path';"); diff --git a/src/bin/scripts/t/091_reindexdb_all.pl b/src/bin/scripts/t/091_reindexdb_all.pl index 34174e4d71..acb2418976 100644 --- a/src/bin/scripts/t/091_reindexdb_all.pl +++ b/src/bin/scripts/t/091_reindexdb_all.pl @@ -4,10 +4,10 @@ use strict; use warnings; -use PostgresNode; +use PostgreSQL::Test::Cluster; use Test::More tests => 2; -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/100_vacuumdb.pl b/src/bin/scripts/t/100_vacuumdb.pl index 0f1e5bb278..6937a35bc4 100644 --- a/src/bin/scripts/t/100_vacuumdb.pl +++ b/src/bin/scripts/t/100_vacuumdb.pl @@ -4,15 +4,15 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 58; program_help_ok('vacuumdb'); program_version_ok('vacuumdb'); program_options_handling_ok('vacuumdb'); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/101_vacuumdb_all.pl b/src/bin/scripts/t/101_vacuumdb_all.pl index a60fc79aae..3dfbfbfdb2 100644 --- a/src/bin/scripts/t/101_vacuumdb_all.pl +++ b/src/bin/scripts/t/101_vacuumdb_all.pl @@ -4,10 +4,10 @@ use strict; use warnings; -use PostgresNode; +use PostgreSQL::Test::Cluster; use Test::More tests => 2; -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/102_vacuumdb_stages.pl b/src/bin/scripts/t/102_vacuumdb_stages.pl index c15057a763..f7bd45ba92 100644 --- a/src/bin/scripts/t/102_vacuumdb_stages.pl +++ b/src/bin/scripts/t/102_vacuumdb_stages.pl @@ -4,10 +4,10 @@ use strict; use warnings; -use PostgresNode; +use PostgreSQL::Test::Cluster; use Test::More tests => 4; -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->start; diff --git a/src/bin/scripts/t/200_connstr.pl b/src/bin/scripts/t/200_connstr.pl index f702e32f00..b2fa50a1c6 100644 --- a/src/bin/scripts/t/200_connstr.pl +++ b/src/bin/scripts/t/200_connstr.pl @@ -4,8 +4,8 @@ use strict; use warnings; -use PostgresNode; -use TestLib; +use PostgreSQL::Test::Cluster; +use PostgreSQL::Test::Utils; use Test::More tests => 3; # Tests to check connection string handling in utilities @@ -23,7 +23,7 @@ my $dbname2 = my $dbname3 = generate_ascii_string(130, 192); my $dbname4 = generate_ascii_string(193, 255); -my $node = PostgresNode->new('main'); +my $node = PostgreSQL::Test::Cluster->new('main'); $node->init(extra => [ '--locale=C', '--encoding=LATIN1' ]); $node->start; |
