diff options
| author | Peter Eisentraut | 2023-03-03 06:18:20 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2023-03-03 06:45:52 +0000 |
| commit | b6a0d469cae4410a05b5e109748278065a931b68 (patch) | |
| tree | 6324fe8028daa362b870740439c719bf71fa0116 /meson.build | |
| parent | b1307b8b60111be8ddd8d6127701883c047bed15 (diff) | |
meson: Prevent installation of test files during main install
Previously, meson installed modules under src/test/modules/ as part of
a normal installation, even though these files are only meant for use
by tests. This is because there is no way to set up up the build
system to install extra things only when told.
This patch fixes that with a workaround: We don't install these
modules as part of meson install, but we create a new "test" that runs
before the real tests whose action it is to install these files. The
installation is done by manual copies using a small helper script.
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/2a039e8e-f31f-31e8-afe7-bab3130ad2de%40enterprisedb.com
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 26be83afb61..87cb974ad7c 100644 --- a/meson.build +++ b/meson.build @@ -2801,6 +2801,10 @@ backend_code = declare_dependency( dependencies: os_deps + backend_both_deps + backend_deps, ) +# install these files only during test, not main install +test_install_data = [] +test_install_libs = [] + # src/backend/meson.build defines backend_mod_code used for extension # libraries. @@ -2821,6 +2825,10 @@ subdir('doc/src/sgml') generated_sources_ac += {'': ['GNUmakefile']} +# After processing src/test, add test_install_libs to the testprep_targets +# to build them +testprep_targets += test_install_libs + # If there are any files in the source directory that we also generate in the # build directory, they might get preferred over the newly generated files, @@ -2903,14 +2911,36 @@ meson_install_args = meson_args + ['install'] + { 'muon': [] }[meson_impl] +# setup tests should be run first, +# so define priority for these +setup_tests_priority = 100 test('tmp_install', meson_bin, args: meson_install_args , env: {'DESTDIR':test_install_destdir}, - priority: 100, + priority: setup_tests_priority, timeout: 300, is_parallel: false, suite: ['setup']) +# get full paths of test_install_libs to copy them +test_install_libs_fp = [] +foreach lib: test_install_libs + test_install_libs_fp += lib.full_path() +endforeach + +install_test_files = files('src/tools/install_test_files') +test('install_test_files', + python, args: [ + install_test_files, + '--datadir', test_install_location / contrib_data_args['install_dir'], + '--libdir', test_install_location / dir_lib_pkg, + '--install-data', test_install_data, + '--install-libs', test_install_libs_fp, + ], + priority: setup_tests_priority, + is_parallel: false, + suite: ['setup']) + test_result_dir = meson.build_root() / 'testrun' |
