=======================
- All 115 tests passed.
+ All 193 tests passed.
=======================
To run the tests after installation (see ),
- initialize a data area and start the
+ initialize a data directory and start the
server as explained in , then type:
make installcheck
The tests will also transiently create some cluster-wide objects, such as
- roles and tablespaces. These objects will have names beginning with
- regress_ . Beware of using installcheck
- mode in installations that have any actual users or tablespaces named
- that way.
+ roles, tablespaces, and subscriptions. These objects will have names
+ beginning with regress_ . Beware of
+ using installcheck mode with an installation that has
+ any actual global objects named that way.
The make check and make installcheck commands
run only the core
regression tests, which test built-in
functionality of the
PostgreSQL server. The source
- distribution also contains additional test suites, most of them having
+ distribution contains many additional test suites, most of them having
to do with add-on functionality such as optional procedural languages.
already-installed server, respectively, just as previously explained
for make check and make installcheck . Other
considerations are the same as previously explained for each method.
- Note that make check-world builds a separate temporary
- installation tree for each tested module, so it requires a great deal
- more time and disk space than make installcheck-world .
+ Note that make check-world builds a separate instance
+ (temporary data directory) for each tested module, so it requires more
+ time and disk space than make installcheck-world .
+
+
+ On a modern machine with multiple CPU cores and no tight operating-system
+ limits, you can make things go substantially faster with parallelism.
+ The recipe that most PostgreSQL developers actually use for running all
+ tests is something like
+
+make check-world -j8 >/dev/null
+
+ with a -j limit near to or a bit more than the number
+ of available cores. Discarding stdout
+ eliminates chatter that's not interesting when you just want to verify
+ success. (In case of failure, the stderr
+ messages are usually enough to determine where to look closer.)
- Regression tests for optional procedural languages (other than
-
PL/pgSQL , which is tested by the core tests).
+ Regression tests for optional procedural languages.
These are located under src/pl .
located in src/interfaces/ecpg/test .
+
+ Tests for core-supported authentication methods,
+ located in src/test/authentication .
+ (See below for additional authentication-related tests.)
+
+
Tests stressing behavior of concurrent sessions,
- Tests of client programs under src/bin . See
- also .
+ Tests for crash recovery and physical replication,
+ located in src/test/recovery .
+
+
+
+ Tests for logical replication,
+ located in src/test/subscription .
+
+
+
+ Tests of client programs, located under src/bin .
- When using installcheck mode, these tests will destroy any
- existing databases named pl_regression ,
- contrib_regression , isolation_regression ,
- ecpg1_regression , or ecpg2_regression , as well as
- regression .
+ When using installcheck mode, these tests will create
+ and destroy test databases whose names
+ include regression , for
+ example pl_regression
+ or contrib_regression . Beware of
+ using installcheck mode with an installation that has
+ any non-test databases named that way.
+ Some of these auxiliary test suites use the TAP infrastructure explained
+ in .
The TAP-based tests are run only when PostgreSQL was configured with the
option --enable-tap-tests . This is recommended for
development, but can be omitted if there is no suitable Perl installation.
configuration are not run even if they are mentioned in
PG_TEST_EXTRA .
+
+ In addition, there are tests in src/test/modules
+ which will be run by make check-world but not
+ by make installcheck-world . This is because they
+ install non-production extensions or have other side-effects that are
+ considered undesirable for a production installation. You can
+ use make install and make
+ installcheck in one of those subdirectories if you wish,
+ but it's not recommended to do so with a non-test server.
+
The TAP tests require the Perl module IPC::Run .
This module is available from CPAN or an operating system package.
+
+ Generically speaking, the TAP tests will test the executables in a
+ previously-installed installation tree if you say make
+ installcheck, or will build a new local installation tree from
+ current sources if you say make check . In either
+ case they will initialize a local instance (data directory) and
+ transiently run a server in it. Some of these tests run more than one
+ server. Thus, these tests can be fairly resource-intensive.
+
+
+ It's important to realize that the TAP tests will start test server(s)
+ even when you say make installcheck ; this is unlike
+ the traditional non-TAP testing infrastructure, which expects to use an
+ already-running test server in that case. Some PostgreSQL
+ subdirectories contain both traditional-style and TAP-style tests,
+ meaning that make installcheck will produce a mix of
+ results from temporary servers and the already-running test server.
+
stmt->tablespacename),
errdetail("The prefix \"pg_\" is reserved for system tablespaces.")));
+ /*
+ * If built with appropriate switch, whine when regression-testing
+ * conventions for tablespace names are violated.
+ */
+#ifdef ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
+ if (strncmp(stmt->tablespacename, "regress_", 8) != 0)
+ elog(WARNING, "tablespaces created by regression test cases should have names starting with \"regress_\"");
+#endif
+
/*
* Check that there is no other tablespace by this name. (The unique
* index would catch this anyway, but might as well give a friendlier
errmsg("unacceptable tablespace name \"%s\"", newname),
errdetail("The prefix \"pg_\" is reserved for system tablespaces.")));
+ /*
+ * If built with appropriate switch, whine when regression-testing
+ * conventions for tablespace names are violated.
+ */
+#ifdef ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS
+ if (strncmp(newname, "regress_", 8) != 0)
+ elog(WARNING, "tablespaces created by regression test cases should have names starting with \"regress_\"");
+#endif
+
/* Make sure the new name doesn't exist */
ScanKeyInit(&entry[0],
Anum_pg_tablespace_spcname,