@@ -2818,6 +2818,10 @@ backend_code = declare_dependency(
28182818 dependencies : os_deps + backend_both_deps + backend_deps,
28192819)
28202820
2821+ # install these files only during test, not main install
2822+ test_install_files = []
2823+ test_install_libs = []
2824+
28212825# src/backend/meson.build defines backend_mod_code used for extension
28222826# libraries.
28232827
@@ -2838,6 +2842,10 @@ subdir('doc/src/sgml')
28382842
28392843generated_sources_ac += {'' : [' GNUmakefile' ]}
28402844
2845+ # After processing src/test, add test_install_libs to the testprep_targets
2846+ # to build them
2847+ testprep_targets += test_install_libs
2848+
28412849
28422850# If there are any files in the source directory that we also generate in the
28432851# build directory, they might get preferred over the newly generated files,
@@ -2928,14 +2936,36 @@ meson_install_args = meson_args + ['install'] + {
29282936 ' muon' : []
29292937}[meson_impl]
29302938
2939+ # setup tests should be run first,
2940+ # so define priority for these
2941+ setup_tests_priority = 100
29312942test (' tmp_install' ,
29322943 meson_bin, args : meson_install_args ,
29332944 env : {' DESTDIR' :test_install_destdir},
2934- priority : 100 ,
2945+ priority : setup_tests_priority ,
29352946 timeout : 300 ,
29362947 is_parallel : false ,
29372948 suite : [' setup' ])
29382949
2950+ # get full paths of test_install_libs to copy them
2951+ test_install_libs_fp = []
2952+ foreach lib : test_install_libs
2953+ test_install_libs_fp += lib.full_path()
2954+ endforeach
2955+
2956+ install_additional_files = files (' src/test/install_additional_files' )
2957+ test (' install_additional_files' ,
2958+ python, args : [
2959+ install_additional_files,
2960+ ' --sharedir' , test_install_location / contrib_data_args[' install_dir' ],
2961+ ' --libdir' , test_install_location / dir_lib_pkg,
2962+ ' --install_files' , test_install_files,
2963+ ' --install_libs' , test_install_libs_fp,
2964+ ],
2965+ priority : setup_tests_priority,
2966+ is_parallel : false ,
2967+ suite : [' setup' ])
2968+
29392969test_result_dir = meson .build_root() / ' testrun'
29402970
29412971
0 commit comments