summaryrefslogtreecommitdiff
path: root/tests/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'tests/meson.build')
-rw-r--r--tests/meson.build51
1 files changed, 46 insertions, 5 deletions
diff --git a/tests/meson.build b/tests/meson.build
index f2d5e79..0f28c39 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -12,6 +12,47 @@ add_test_setup('msan')
test('basic', test_exe)
+shared_dep = declare_dependency(
+ link_with: yasl_lib.get_shared_lib(),
+ include_directories: include_directories('../include'),
+)
+
+shared_api_test = executable(
+ 'yasl-shared-api-test',
+ 'test_lifecycle.c',
+ dependencies: shared_dep,
+)
+test('shared-api', shared_api_test)
+
+if add_languages('cpp', native: false, required: false)
+ cpp = meson.get_compiler('cpp')
+ cpp_api_test = executable(
+ 'yasl-cpp-api-test',
+ 'test_api.cpp',
+ dependencies: shared_dep,
+ cpp_args: cpp.get_supported_arguments('-pedantic-errors'),
+ override_options: ['cpp_std=c++11'],
+ )
+ test('cpp-api', cpp_api_test)
+endif
+
+python = find_program('python3')
+if system == 'linux'
+ nm = find_program('nm')
+ export_args = []
+ if get_option('b_sanitize').contains('address')
+ # Clang's ASan instrumentation exports these linker-generated markers.
+ export_args += ['--allow-export=__start_asan_globals',
+ '--allow-export=__stop_asan_globals']
+ endif
+ test('public-exports', python,
+ args: [files('helpers/check_exports.py')] + export_args +
+ [nm, yasl_lib.get_shared_lib(),
+ files('../include/yasl/yasl.h', '../include/yasl/timing.h',
+ '../include/yasl/loop.h', '../include/yasl/native.h')],
+ )
+endif
+
contracts_test = executable(
'yasl-contracts-test',
'common/test_contracts.c',
@@ -54,11 +95,11 @@ endif
if get_option('integration_tests')
if has_cocoa
native_test = executable('yasl-native-test', 'cocoa/test_native.c',
- dependencies: yasl_dep,
+ dependencies: shared_dep,
)
test('native', native_test, timeout: 20)
ownership_test = executable('yasl-ownership-test', 'cocoa/test_ownership.m',
- dependencies: yasl_dep,
+ dependencies: [shared_dep, deps],
)
test('native-ownership', ownership_test, timeout: 20)
else
@@ -68,13 +109,13 @@ if get_option('integration_tests')
backend_test = executable(
'yasl-backend-test',
'common/test_backends.c',
- dependencies: yasl_dep,
+ dependencies: [shared_dep, deps],
)
- python = find_program('python3')
weston = find_program('weston')
xwayland = find_program('Xwayland')
test('backends', python,
- args: [files('helpers/run_backends.py'), weston, xwayland, backend_test],
+ args: [files('helpers/run_backends.py'), weston, xwayland,
+ backend_test, timer_test],
timeout: 60,
)
endif