pipewire/test/meson.build
Peter Hutterer 9a65d90e88 test: move the spa tests to pwtest
Move the spa tests to the pwtest framework. The pod tests have only been
wrapped in the function callers, they don't use the variuos pwtest helpers -
too much work for very little gain here. Can be done incrementally if needed.

Note that this removes the spa tests from the installed tests. Arguably,
installing those tests was unnecessary anyway since they are static binaries
and don't load anything. So having them installed runs the same tests as
having them run in the source tree.

Goal for the pwtest framework is to allow for installed tests, just not there
yet.
2021-06-09 18:00:59 +10:00

90 lines
2.1 KiB
Meson

pwtest_sources = [
'pwtest.h',
'pwtest-implementation.h',
'pwtest.c',
]
pwtest_deps = [
pipewire_dep,
mathlib,
dl_lib,
]
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)
test('test pipewire utils',
executable('test-pw-utils',
'test-properties.c',
'test-array.c',
include_directories: pwtest_inc,
link_with: pwtest_lib)
)
test('test lib',
executable('test-lib',
'test-lib.c',
include_directories: pwtest_inc,
link_with: pwtest_lib)
)
test('test context',
executable('test-context',
'test-context.c',
include_directories: pwtest_inc,
link_with: pwtest_lib)
)
test('test support',
executable('test-support',
'test-support.c',
'test-logger.c',
include_directories: pwtest_inc,
link_with: pwtest_lib)
)
test('test spa',
executable('test-spa',
'test-spa-buffer.c',
'test-spa-json.c',
'test-spa-utils.c',
'test-spa-node.c',
'test-spa-pod.c',
include_directories: pwtest_inc,
link_with: pwtest_lib)
)
valgrind = find_program('valgrind', required: false)
if valgrind.found()
valgrind_env = environment()
add_test_setup('valgrind',
exe_wrapper : [ valgrind,
'--leak-check=full',
'--gen-suppressions=all',
'--error-exitcode=3',
],
env : valgrind_env,
timeout_multiplier : 100)
endif