mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
Heavily inspired by libinput's litest framework (built around check), this is a from-scratch framework that simplifies adding tests for various parts of pipewire. See the pwtest.h documentation for details but the basics are: - PW_TEST() and PWTEST_SUITE() specify the tests to be run - Test are run in forked processes, any errors/signals are caught and printed to the log - Tests have a custom pipewire daemon started on demand to talk to [1]. The daemon's log is available in the test output. - Output is YAML to be processed into whatever format needed [1] There are limits here, since we can't emulate devices yet there is only so much we can rely on with the daemon.
38 lines
704 B
Meson
38 lines
704 B
Meson
pwtest_sources = [
|
|
'pwtest.h',
|
|
'pwtest-implementation.h',
|
|
'pwtest.c',
|
|
]
|
|
|
|
pwtest_deps = [
|
|
pipewire_dep,
|
|
mathlib,
|
|
]
|
|
|
|
pwtest_c_args = [
|
|
'-DHAVE_CONFIG_H',
|
|
'-DBUILD_ROOT="@0@"'.format(meson.build_root()),
|
|
'-DSOURCE_ROOT="@0@"'.format(meson.source_root()),
|
|
]
|
|
|
|
pwtest_inc = [
|
|
spa_inc,
|
|
pipewire_inc,
|
|
configinc,
|
|
includes_inc,
|
|
]
|
|
|
|
pwtest_lib = static_library(
|
|
'pwtest',
|
|
pwtest_sources,
|
|
c_args: pwtest_c_args,
|
|
dependencies: pwtest_deps,
|
|
include_directories: pwtest_inc,
|
|
)
|
|
|
|
# Compilation only, this is the example file for how pwtest works and most
|
|
# of its tests will fail.
|
|
executable('test-example',
|
|
'test-example.c',
|
|
include_directories: pwtest_inc,
|
|
link_with: pwtest_lib)
|