mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	Optionally install examples and tests
This makes it easier to test PipeWire in its "as-installed" state,
for example in an OS distribution.
The .test metadata files in ${datadir}/installed-tests/${package} are
a convention taken from GNOME's installed-tests initiative, allowing a
generic test-runner like gnome-desktop-testing to discover and run tests
in an automatic way.
The installation path ${libexecdir}/installed-tests/${package} is also
a convention borrowed from GNOME's installed-tests initiative.
In addition to the automated tests, I've installed example executables
in the same place, for manual testing. They could be separated into
a different directory if desired, but they seem like they have more
similarities with the automated tests than differences: both are there
to test that PipeWire works correctly, and neither should be relied on
for production use. Some examples are installed in deeper subdirectories
to avoid name clashes.
Signed-off-by: Simon McVittie <smcv@debian.org>
			
			
This commit is contained in:
		
							parent
							
								
									8b97d2ae74
								
							
						
					
					
						commit
						b852b58f82
					
				
					 10 changed files with 158 additions and 27 deletions
				
			
		|  | @ -30,6 +30,7 @@ prefix = get_option('prefix') | ||||||
| pipewire_bindir = join_paths(prefix, get_option('bindir')) | pipewire_bindir = join_paths(prefix, get_option('bindir')) | ||||||
| pipewire_datadir = join_paths(prefix, get_option('datadir')) | pipewire_datadir = join_paths(prefix, get_option('datadir')) | ||||||
| pipewire_libdir = join_paths(prefix, get_option('libdir')) | pipewire_libdir = join_paths(prefix, get_option('libdir')) | ||||||
|  | pipewire_libexecdir = join_paths(prefix, get_option('libexecdir')) | ||||||
| pipewire_localedir = join_paths(prefix, get_option('localedir')) | pipewire_localedir = join_paths(prefix, get_option('localedir')) | ||||||
| pipewire_sysconfdir = join_paths(prefix, get_option('sysconfdir')) | pipewire_sysconfdir = join_paths(prefix, get_option('sysconfdir')) | ||||||
| 
 | 
 | ||||||
|  | @ -303,6 +304,11 @@ alsa_dep = (get_option('pipewire-alsa') | ||||||
|     ? dependency('alsa', version : '>=1.1.7') |     ? dependency('alsa', version : '>=1.1.7') | ||||||
|     : dependency('', required: false)) |     : dependency('', required: false)) | ||||||
| 
 | 
 | ||||||
|  | installed_tests_metadir = join_paths(pipewire_datadir, 'installed-tests', pipewire_name) | ||||||
|  | installed_tests_execdir = join_paths(pipewire_libexecdir, 'installed-tests', pipewire_name) | ||||||
|  | installed_tests_enabled = get_option('installed_tests') | ||||||
|  | installed_tests_template = files('template.test.in') | ||||||
|  | 
 | ||||||
| subdir('spa') | subdir('spa') | ||||||
| subdir('src') | subdir('src') | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -14,6 +14,10 @@ option('tests', | ||||||
|        description: 'Build tests', |        description: 'Build tests', | ||||||
|        type: 'boolean', |        type: 'boolean', | ||||||
|        value: true) |        value: true) | ||||||
|  | option('installed_tests', | ||||||
|  |        description: 'Install manual and automated test executables', | ||||||
|  |        type: 'boolean', | ||||||
|  |        value: false) | ||||||
| option('gstreamer', | option('gstreamer', | ||||||
|        description: 'Build GStreamer plugins', |        description: 'Build GStreamer plugins', | ||||||
|        type: 'boolean', |        type: 'boolean', | ||||||
|  |  | ||||||
|  | @ -70,7 +70,8 @@ if sdl_dep.found() | ||||||
|   executable('video-dsp-play', |   executable('video-dsp-play', | ||||||
|     '../examples/video-dsp-play.c', |     '../examples/video-dsp-play.c', | ||||||
|     c_args : [ '-D_GNU_SOURCE' ], |     c_args : [ '-D_GNU_SOURCE' ], | ||||||
|     install: false, |     install : installed_tests_enabled, | ||||||
|  |     install_dir : join_paths(installed_tests_execdir, 'examples', 'jack'), | ||||||
|     dependencies : [jack_dep, sdl_dep, mathlib], |     dependencies : [jack_dep, sdl_dep, mathlib], | ||||||
|     link_with: pipewire_jack, |     link_with: pipewire_jack, | ||||||
|   ) |   ) | ||||||
|  |  | ||||||
|  | @ -3,14 +3,16 @@ if sdl_dep.found() | ||||||
|              include_directories : [configinc, spa_inc], |              include_directories : [configinc, spa_inc], | ||||||
|              c_args : ['-D_GNU_SOURCE'], |              c_args : ['-D_GNU_SOURCE'], | ||||||
|              dependencies : [dl_lib, sdl_dep, pthread_lib], |              dependencies : [dl_lib, sdl_dep, pthread_lib], | ||||||
|              install : false) |              install : installed_tests_enabled, | ||||||
|  |              install_dir : join_paths(installed_tests_execdir, 'examples', 'spa')) | ||||||
| 
 | 
 | ||||||
|   if get_option('libcamera') and libcamera_dep.found() |   if get_option('libcamera') and libcamera_dep.found() | ||||||
|     executable('local-libcamera', 'local-libcamera.c', |     executable('local-libcamera', 'local-libcamera.c', | ||||||
|                include_directories : [configinc, spa_inc], |                include_directories : [configinc, spa_inc], | ||||||
|                c_args : ['-D_GNU_SOURCE'], |                c_args : ['-D_GNU_SOURCE'], | ||||||
|                dependencies : [dl_lib, sdl_dep, pthread_lib, libcamera_dep], |                dependencies : [dl_lib, sdl_dep, pthread_lib, libcamera_dep], | ||||||
|                install : false) |                install : installed_tests_enabled, | ||||||
|  |                install_dir : join_paths(installed_tests_execdir, 'examples', 'spa')) | ||||||
|   endif |   endif | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
|  | @ -18,10 +20,12 @@ executable('example-control', 'example-control.c', | ||||||
|              include_directories : [configinc, spa_inc], |              include_directories : [configinc, spa_inc], | ||||||
|              c_args : ['-D_GNU_SOURCE'], |              c_args : ['-D_GNU_SOURCE'], | ||||||
|              dependencies : [dl_lib, pthread_lib, mathlib], |              dependencies : [dl_lib, pthread_lib, mathlib], | ||||||
|              install : false) |              install : installed_tests_enabled, | ||||||
|  |              install_dir : join_paths(installed_tests_execdir, 'examples', 'spa')) | ||||||
| 
 | 
 | ||||||
| executable('adapter-control', 'adapter-control.c', | executable('adapter-control', 'adapter-control.c', | ||||||
|              include_directories : [configinc, spa_inc], |              include_directories : [configinc, spa_inc], | ||||||
|              c_args : ['-D_GNU_SOURCE'], |              c_args : ['-D_GNU_SOURCE'], | ||||||
|              dependencies : [dl_lib, pthread_lib, mathlib], |              dependencies : [dl_lib, pthread_lib, mathlib], | ||||||
|              install : false) |              install : installed_tests_enabled, | ||||||
|  |              install_dir : join_paths(installed_tests_execdir, 'examples', 'spa')) | ||||||
|  |  | ||||||
|  | @ -129,11 +129,25 @@ foreach a : test_apps | ||||||
| 		dependencies : [dl_lib, pthread_lib, mathlib ], | 		dependencies : [dl_lib, pthread_lib, mathlib ], | ||||||
| 		include_directories : [spa_inc ], | 		include_directories : [spa_inc ], | ||||||
| 		link_with : [ audioconvert, test_lib, audioconvertlib ], | 		link_with : [ audioconvert, test_lib, audioconvertlib ], | ||||||
|  | 		install_rpath : join_paths(spa_plugindir, 'audioconvert'), | ||||||
| 		c_args : [ simd_cargs, '-D_GNU_SOURCE' ], | 		c_args : [ simd_cargs, '-D_GNU_SOURCE' ], | ||||||
| 		install : false), | 		install : installed_tests_enabled, | ||||||
|  | 		install_dir : join_paths(installed_tests_execdir, 'audioconvert')), | ||||||
| 	env : [ | 	env : [ | ||||||
| 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | ||||||
| 	]) | 	]) | ||||||
|  | 
 | ||||||
|  |   if installed_tests_enabled | ||||||
|  |     test_conf = configuration_data() | ||||||
|  |     test_conf.set('exec', | ||||||
|  |                   join_paths(installed_tests_execdir, 'audioconvert', a)) | ||||||
|  |     configure_file( | ||||||
|  |       input: installed_tests_template, | ||||||
|  |       output: a + '.test', | ||||||
|  |       install_dir: join_paths(installed_tests_metadir, 'audioconvert'), | ||||||
|  |       configuration: test_conf | ||||||
|  |     ) | ||||||
|  |   endif | ||||||
| endforeach | endforeach | ||||||
| 
 | 
 | ||||||
| benchmark_apps = [ | benchmark_apps = [ | ||||||
|  | @ -148,10 +162,24 @@ foreach a : benchmark_apps | ||||||
| 		include_directories : [spa_inc ], | 		include_directories : [spa_inc ], | ||||||
| 		c_args : [ simd_cargs, '-D_GNU_SOURCE' ], | 		c_args : [ simd_cargs, '-D_GNU_SOURCE' ], | ||||||
| 		link_with : [ audioconvert, audioconvertlib ], | 		link_with : [ audioconvert, audioconvertlib ], | ||||||
| 		install : false), | 		install_rpath : join_paths(spa_plugindir, 'audioconvert'), | ||||||
|  | 		install : installed_tests_enabled, | ||||||
|  | 		install_dir : join_paths(installed_tests_execdir, 'audioconvert')), | ||||||
| 	env : [ | 	env : [ | ||||||
| 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | ||||||
| 	]) | 	]) | ||||||
|  | 
 | ||||||
|  |   if installed_tests_enabled | ||||||
|  |     test_conf = configuration_data() | ||||||
|  |     test_conf.set('exec', | ||||||
|  |                   join_paths(installed_tests_execdir, 'audioconvert', a)) | ||||||
|  |     configure_file( | ||||||
|  |       input: installed_tests_template, | ||||||
|  |       output: a + '.test', | ||||||
|  |       install_dir: join_paths(installed_tests_metadir, 'audioconvert'), | ||||||
|  |       configuration: test_conf | ||||||
|  |     ) | ||||||
|  |   endif | ||||||
| endforeach | endforeach | ||||||
| 
 | 
 | ||||||
| if sndfile_dep.found() | if sndfile_dep.found() | ||||||
|  | @ -161,9 +189,10 @@ if sndfile_dep.found() | ||||||
|   executable('spa-resample', |   executable('spa-resample', | ||||||
|     sparesample_sources, |     sparesample_sources, | ||||||
|     c_args : [ simd_cargs, '-D_GNU_SOURCE' ], |     c_args : [ simd_cargs, '-D_GNU_SOURCE' ], | ||||||
|     install: false, |  | ||||||
|     include_directories : [spa_inc ], |     include_directories : [spa_inc ], | ||||||
|     link_with : [ audioconvert, test_lib ], |     link_with : [ audioconvert, test_lib ], | ||||||
|     dependencies : [sndfile_dep, mathlib], |     dependencies : [sndfile_dep, mathlib], | ||||||
|  |     install : installed_tests_enabled, | ||||||
|  |     install_dir : join_paths(installed_tests_execdir, 'examples', 'audioconvert'), | ||||||
|   ) |   ) | ||||||
| endif | endif | ||||||
|  |  | ||||||
|  | @ -11,18 +11,41 @@ foreach a : test_apps | ||||||
| 		dependencies : [dl_lib, pthread_lib, mathlib ], | 		dependencies : [dl_lib, pthread_lib, mathlib ], | ||||||
| 		include_directories : [spa_inc ], | 		include_directories : [spa_inc ], | ||||||
| 		c_args : [ '-D_GNU_SOURCE' ], | 		c_args : [ '-D_GNU_SOURCE' ], | ||||||
| 		install : false), | 		install : installed_tests_enabled, | ||||||
|  | 		install_dir : installed_tests_execdir), | ||||||
| 	env : [ | 	env : [ | ||||||
| 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | ||||||
| 	]) | 	]) | ||||||
|  | 
 | ||||||
|  |   if installed_tests_enabled | ||||||
|  |     test_conf = configuration_data() | ||||||
|  |     test_conf.set('exec', join_paths(installed_tests_execdir, 'spa-' + a)) | ||||||
|  |     configure_file( | ||||||
|  |       input: installed_tests_template, | ||||||
|  |       output: 'spa-' + a + '.test', | ||||||
|  |       install_dir: installed_tests_metadir, | ||||||
|  |       configuration: test_conf | ||||||
|  |     ) | ||||||
|  |   endif | ||||||
| endforeach | endforeach | ||||||
| 
 | 
 | ||||||
| if have_cpp | if have_cpp | ||||||
| test_cpp = executable('spa-test-cpp', 'test-cpp.cpp', | test_cpp = executable('spa-test-cpp', 'test-cpp.cpp', | ||||||
|                         include_directories : [spa_inc ], |                         include_directories : [spa_inc ], | ||||||
|                         dependencies : [], |                         dependencies : [], | ||||||
|                         install : false) |                         install : installed_tests_enabled, | ||||||
|  |                         install_dir : installed_tests_execdir) | ||||||
| test('spa-test-cpp', test_cpp) | test('spa-test-cpp', test_cpp) | ||||||
|  | if installed_tests_enabled | ||||||
|  |   test_conf = configuration_data() | ||||||
|  |   test_conf.set('exec', join_paths(installed_tests_execdir, 'spa-test-cpp')) | ||||||
|  |   configure_file( | ||||||
|  |     input: installed_tests_template, | ||||||
|  |     output: 'spa-test-cpp.test', | ||||||
|  |     install_dir: installed_tests_metadir, | ||||||
|  |     configuration: test_conf | ||||||
|  |   ) | ||||||
|  | endif | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| benchmark_apps = [ | benchmark_apps = [ | ||||||
|  | @ -37,8 +60,20 @@ foreach a : benchmark_apps | ||||||
| 		dependencies : [dl_lib, pthread_lib, mathlib ], | 		dependencies : [dl_lib, pthread_lib, mathlib ], | ||||||
| 		include_directories : [spa_inc ], | 		include_directories : [spa_inc ], | ||||||
| 		c_args : [ '-D_GNU_SOURCE' ], | 		c_args : [ '-D_GNU_SOURCE' ], | ||||||
| 		install : false), | 		install : installed_tests_enabled, | ||||||
|  | 		install_dir : installed_tests_execdir), | ||||||
| 	env : [ | 	env : [ | ||||||
| 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | ||||||
| 	]) | 	]) | ||||||
|  | 
 | ||||||
|  |   if installed_tests_enabled | ||||||
|  |     test_conf = configuration_data() | ||||||
|  |     test_conf.set('exec', join_paths(installed_tests_execdir, 'spa-' + a)) | ||||||
|  |     configure_file( | ||||||
|  |       input: installed_tests_template, | ||||||
|  |       output: 'spa-' + a + '.test', | ||||||
|  |       install_dir: installed_tests_metadir, | ||||||
|  |       configuration: test_conf | ||||||
|  |     ) | ||||||
|  |   endif | ||||||
| endforeach | endforeach | ||||||
|  |  | ||||||
|  | @ -1,52 +1,60 @@ | ||||||
| executable('video-src', | executable('video-src', | ||||||
|   'video-src.c', |   'video-src.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| executable('video-src-alloc', | executable('video-src-alloc', | ||||||
|   'video-src-alloc.c', |   'video-src-alloc.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| executable('audio-src', | executable('audio-src', | ||||||
|   'audio-src.c', |   'audio-src.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| executable('audio-dsp-src', | executable('audio-dsp-src', | ||||||
|   'audio-dsp-src.c', |   'audio-dsp-src.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| executable('export-source', | executable('export-source', | ||||||
|   'export-source.c', |   'export-source.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| executable('audio-dsp-filter', | executable('audio-dsp-filter', | ||||||
|   'audio-dsp-filter.c', |   'audio-dsp-filter.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| executable('export-spa', | executable('export-spa', | ||||||
|   'export-spa.c', |   'export-spa.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| executable('export-spa-device', | executable('export-spa-device', | ||||||
|   'export-spa-device.c', |   'export-spa-device.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -76,7 +84,8 @@ endif | ||||||
| executable('bluez-session', | executable('bluez-session', | ||||||
|   'bluez-session.c', |   'bluez-session.c', | ||||||
|   c_args : [ '-D_GNU_SOURCE' ], |   c_args : [ '-D_GNU_SOURCE' ], | ||||||
|   install: false, |   install : installed_tests_enabled, | ||||||
|  |   install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|   dependencies : [pipewire_dep, mathlib], |   dependencies : [pipewire_dep, mathlib], | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | @ -84,27 +93,31 @@ if sdl_dep.found() | ||||||
|   executable('video-play', |   executable('video-play', | ||||||
|     'video-play.c', |     'video-play.c', | ||||||
|     c_args : [ '-D_GNU_SOURCE' ], |     c_args : [ '-D_GNU_SOURCE' ], | ||||||
|     install: false, |     install : installed_tests_enabled, | ||||||
|  |     install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|     dependencies : [pipewire_dep, sdl_dep, mathlib], |     dependencies : [pipewire_dep, sdl_dep, mathlib], | ||||||
|   ) |   ) | ||||||
|   executable('video-dsp-play', |   executable('video-dsp-play', | ||||||
|     'video-dsp-play.c', |     'video-dsp-play.c', | ||||||
|     c_args : [ '-D_GNU_SOURCE' ], |     c_args : [ '-D_GNU_SOURCE' ], | ||||||
|     install: false, |     install : installed_tests_enabled, | ||||||
|  |     install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|     dependencies : [pipewire_dep, sdl_dep, mathlib], |     dependencies : [pipewire_dep, sdl_dep, mathlib], | ||||||
|   ) |   ) | ||||||
| 
 | 
 | ||||||
|   executable('local-v4l2', |   executable('local-v4l2', | ||||||
|     'local-v4l2.c', |     'local-v4l2.c', | ||||||
|     c_args : [ '-D_GNU_SOURCE' ], |     c_args : [ '-D_GNU_SOURCE' ], | ||||||
|     install: false, |     install : installed_tests_enabled, | ||||||
|  |     install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|     dependencies : [pipewire_dep, sdl_dep], |     dependencies : [pipewire_dep, sdl_dep], | ||||||
|   ) |   ) | ||||||
| 
 | 
 | ||||||
|   executable('export-sink', |   executable('export-sink', | ||||||
|     'export-sink.c', |     'export-sink.c', | ||||||
|     c_args : [ '-D_GNU_SOURCE' ], |     c_args : [ '-D_GNU_SOURCE' ], | ||||||
|     install: false, |     install : installed_tests_enabled, | ||||||
|  |     install_dir : join_paths(installed_tests_execdir, 'examples'), | ||||||
|     dependencies : [pipewire_dep, sdl_dep, mathlib], |     dependencies : [pipewire_dep, sdl_dep, mathlib], | ||||||
|   ) |   ) | ||||||
| endif | endif | ||||||
|  |  | ||||||
|  | @ -127,12 +127,24 @@ test('pw-test-protocol-native', | ||||||
| 			c_args : libpipewire_c_args, | 			c_args : libpipewire_c_args, | ||||||
| 			include_directories : [configinc, spa_inc ], | 			include_directories : [configinc, spa_inc ], | ||||||
| 			dependencies : [pipewire_dep], | 			dependencies : [pipewire_dep], | ||||||
| 			install : false), | 			install : installed_tests_enabled, | ||||||
|  | 			install_dir : installed_tests_execdir), | ||||||
| 	env : [ | 	env : [ | ||||||
| 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | ||||||
| 		'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) | 		'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) | ||||||
| 	]) | 	]) | ||||||
| 
 | 
 | ||||||
|  | if installed_tests_enabled | ||||||
|  |   test_conf = configuration_data() | ||||||
|  |   test_conf.set('exec', join_paths(installed_tests_execdir, 'pw-test-protocol-native')) | ||||||
|  |   configure_file( | ||||||
|  |     input: installed_tests_template, | ||||||
|  |     output: 'pw-test-protocol-native.test', | ||||||
|  |     install_dir: installed_tests_metadir, | ||||||
|  |     configuration: test_conf | ||||||
|  |   ) | ||||||
|  | endif | ||||||
|  | 
 | ||||||
| pipewire_module_adapter = shared_library('pipewire-module-adapter', | pipewire_module_adapter = shared_library('pipewire-module-adapter', | ||||||
|   [ 'module-adapter.c', |   [ 'module-adapter.c', | ||||||
|     'module-adapter/adapter.c', |     'module-adapter/adapter.c', | ||||||
|  |  | ||||||
|  | @ -15,17 +15,41 @@ foreach a : test_apps | ||||||
| 	executable('pw-' + a, a + '.c', | 	executable('pw-' + a, a + '.c', | ||||||
| 		dependencies : [pipewire_dep], | 		dependencies : [pipewire_dep], | ||||||
| 		c_args : [ '-D_GNU_SOURCE' ], | 		c_args : [ '-D_GNU_SOURCE' ], | ||||||
| 		install : false), | 		install : installed_tests_enabled, | ||||||
|  | 		install_dir : installed_tests_execdir), | ||||||
| 	env : [ | 	env : [ | ||||||
| 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | 		'SPA_PLUGIN_DIR=@0@/spa/plugins/'.format(meson.build_root()), | ||||||
| 		'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) | 		'PIPEWIRE_MODULE_DIR=@0@/src/modules/'.format(meson.build_root()) | ||||||
| 	]) | 	]) | ||||||
|  | 
 | ||||||
|  |   if installed_tests_enabled | ||||||
|  |     test_conf = configuration_data() | ||||||
|  |     test_conf.set('exec', join_paths(installed_tests_execdir, 'pw-' + a)) | ||||||
|  |     configure_file( | ||||||
|  |       input: installed_tests_template, | ||||||
|  |       output: 'pw-' + a + '.test', | ||||||
|  |       install_dir: installed_tests_metadir, | ||||||
|  |       configuration: test_conf | ||||||
|  |     ) | ||||||
|  |   endif | ||||||
| endforeach | endforeach | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| if have_cpp | if have_cpp | ||||||
| test_cpp = executable('pw-test-cpp', 'test-cpp.cpp', | test_cpp = executable('pw-test-cpp', 'test-cpp.cpp', | ||||||
|                         dependencies : [pipewire_dep], |                         dependencies : [pipewire_dep], | ||||||
|                         install : false) |                         install : installed_tests_enabled, | ||||||
|  |                         install_dir : installed_tests_execdir) | ||||||
| test('pw-test-cpp', test_cpp) | test('pw-test-cpp', test_cpp) | ||||||
|  | 
 | ||||||
|  | if installed_tests_enabled | ||||||
|  |   test_conf = configuration_data() | ||||||
|  |   test_conf.set('exec', join_paths(installed_tests_execdir, 'pw-test-cpp')) | ||||||
|  |   configure_file( | ||||||
|  |     input: installed_tests_template, | ||||||
|  |     output: 'pw-test-cpp.test', | ||||||
|  |     install_dir: installed_tests_metadir, | ||||||
|  |     configuration: test_conf | ||||||
|  |   ) | ||||||
|  | endif | ||||||
| endif | endif | ||||||
|  |  | ||||||
							
								
								
									
										3
									
								
								template.test.in
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								template.test.in
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | ||||||
|  | [Test] | ||||||
|  | Type=session | ||||||
|  | Exec=@exec@ | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Simon McVittie
						Simon McVittie