mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-09 13:30:06 -05: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
|
|
@ -1,52 +1,60 @@
|
|||
executable('video-src',
|
||||
'video-src.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
executable('video-src-alloc',
|
||||
'video-src-alloc.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
executable('audio-src',
|
||||
'audio-src.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
executable('audio-dsp-src',
|
||||
'audio-dsp-src.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
executable('export-source',
|
||||
'export-source.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
|
||||
executable('audio-dsp-filter',
|
||||
'audio-dsp-filter.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
|
||||
executable('export-spa',
|
||||
'export-spa.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
|
||||
executable('export-spa-device',
|
||||
'export-spa-device.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
|
||||
|
|
@ -76,7 +84,8 @@ endif
|
|||
executable('bluez-session',
|
||||
'bluez-session.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, mathlib],
|
||||
)
|
||||
|
||||
|
|
@ -84,27 +93,31 @@ if sdl_dep.found()
|
|||
executable('video-play',
|
||||
'video-play.c',
|
||||
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],
|
||||
)
|
||||
executable('video-dsp-play',
|
||||
'video-dsp-play.c',
|
||||
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],
|
||||
)
|
||||
|
||||
executable('local-v4l2',
|
||||
'local-v4l2.c',
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install: false,
|
||||
install : installed_tests_enabled,
|
||||
install_dir : join_paths(installed_tests_execdir, 'examples'),
|
||||
dependencies : [pipewire_dep, sdl_dep],
|
||||
)
|
||||
|
||||
executable('export-sink',
|
||||
'export-sink.c',
|
||||
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],
|
||||
)
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -127,12 +127,24 @@ test('pw-test-protocol-native',
|
|||
c_args : libpipewire_c_args,
|
||||
include_directories : [configinc, spa_inc ],
|
||||
dependencies : [pipewire_dep],
|
||||
install : false),
|
||||
install : installed_tests_enabled,
|
||||
install_dir : installed_tests_execdir),
|
||||
env : [
|
||||
'SPA_PLUGIN_DIR=@0@/spa/plugins/'.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',
|
||||
[ 'module-adapter.c',
|
||||
'module-adapter/adapter.c',
|
||||
|
|
|
|||
|
|
@ -15,17 +15,41 @@ foreach a : test_apps
|
|||
executable('pw-' + a, a + '.c',
|
||||
dependencies : [pipewire_dep],
|
||||
c_args : [ '-D_GNU_SOURCE' ],
|
||||
install : false),
|
||||
install : installed_tests_enabled,
|
||||
install_dir : installed_tests_execdir),
|
||||
env : [
|
||||
'SPA_PLUGIN_DIR=@0@/spa/plugins/'.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
|
||||
|
||||
|
||||
if have_cpp
|
||||
test_cpp = executable('pw-test-cpp', 'test-cpp.cpp',
|
||||
dependencies : [pipewire_dep],
|
||||
install : false)
|
||||
install : installed_tests_enabled,
|
||||
install_dir : installed_tests_execdir)
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue