summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAndres Freund2023-03-08 00:14:18 +0000
committerAndres Freund2023-03-08 19:12:10 +0000
commit0d237aeebaee17943af14159b83a202a3744dbb4 (patch)
tree9d30f2da1b076d2f8d83307c46f8d47b638b123f /meson.build
parent87e4f24d82939ef532b68f37fc66e6a48cff2cd9 (diff)
meson: Add target for installing test files & improve install_test_files
The changes in b6a0d469cae prevented installation of the test files during a normal install. However, the buildfarm intentionally tries to trun the tests against a "real" installation. The new install-test-files target provides that ability. Because we want to install into a normal directory, I removed the necessary munging of the target paths from meson.build and moved it into install-test-files. I also added DESTDIR support, so that installing can redirect the directory if desired. That's used for the tmp_install/ installation now. I didn't like the number of arguments necessary for install_test_files, so I changed it to use --install target list of files which makes it easier to use for further directories, if/when we need them. Discussion: https://postgr.es/m/20230308012940.edexipb3vqylcu6r@awork3.anarazel.de
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 18 insertions, 14 deletions
diff --git a/meson.build b/meson.build
index f1ce4cb8e03..2409cc2254d 100644
--- a/meson.build
+++ b/meson.build
@@ -2830,6 +2830,22 @@ generated_sources_ac += {'': ['GNUmakefile']}
testprep_targets += test_install_libs
+# command to install files used for tests, which aren't installed by default
+install_test_files = files('src/tools/install_test_files')
+install_test_files_args = [
+ install_test_files,
+ '--prefix', dir_prefix,
+ '--install', contrib_data_dir, test_install_data,
+ '--install', dir_lib_pkg, test_install_libs,
+]
+
+# Target installing files required for installcheck of various modules
+run_target('install-test-files',
+ command: [python] + install_test_files_args,
+ depends: testprep_targets,
+)
+
+
# 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,
# e.g. because of a #include "file", which always will search in the current
@@ -2922,21 +2938,9 @@ test('tmp_install',
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,
- ],
+ python,
+ args: install_test_files_args + ['--destdir', test_install_destdir],
priority: setup_tests_priority,
is_parallel: false,
suite: ['setup'])