diff --git a/Makefile b/Makefile index 07a0f45..cce47d3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ include pgxntool/base.mk +# Explicit rather than relying on auto-detect (which enables this whenever +# test/build/*.sql exists) so an accidental deletion of test/build/'s +# contents is a hard error instead of the check silently disappearing. +PGXNTOOL_ENABLE_TEST_BUILD = yes + testdeps: test_extension test_extension: $(DESTDIR)$datadir)/extension/extension_drop_test.control $(wildcard $(TESTDIR)/*) $(DESTDIR)$datadir)/extension/extension_drop_test.control: diff --git a/test/build/build.sql b/test/build/build.sql new file mode 100644 index 0000000..bf3de74 --- /dev/null +++ b/test/build/build.sql @@ -0,0 +1,25 @@ +\set ECHO none +BEGIN; +\i test/pgxntool/psql.sql + +/* + * Install dependencies via CREATE EXTENSION, not \i: this is a real, + * already-published dependency being installed normally, not the extension + * whose raw install script this file exists to test line-by-line below. + */ +CREATE EXTENSION IF NOT EXISTS cat_tools; + +/* + * Suppress NOTICEs from the raw install script itself (e.g. "%TYPE converted + * to ..." with a version-specific source-file LOCATION line) so this file's + * expected output stays stable across PostgreSQL minor versions instead of + * capturing verbose, version-dependent messages. + */ +SET client_min_messages = WARNING; + +\echo +\echo INSTALL +\t +\i sql/extension_drop.sql + +\echo # TRANSACTION INTENTIONALLY LEFT OPEN diff --git a/test/expected/zzz_build.out b/test/build/expected/build.out similarity index 96% rename from test/expected/zzz_build.out rename to test/build/expected/build.out index c66ee3c..44215eb 100644 --- a/test/expected/zzz_build.out +++ b/test/build/expected/build.out @@ -19,6 +19,4 @@ INSTALL - - # TRANSACTION INTENTIONALLY LEFT OPEN diff --git a/test/sql/zzz_build.sql b/test/sql/zzz_build.sql deleted file mode 100644 index 354c480..0000000 --- a/test/sql/zzz_build.sql +++ /dev/null @@ -1,12 +0,0 @@ -\set ECHO none -BEGIN; -\i test/pgxntool/psql.sql - -CREATE EXTENSION IF NOT EXISTS cat_tools; - -\echo -\echo INSTALL -\t -\i sql/extension_drop.sql - -\echo # TRANSACTION INTENTIONALLY LEFT OPEN