mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-16 20:56:52 -04:00
This allows doing:
meson setup _build
meson test -C _build
without an intervening `meson compile` step. Previously, this would have
failed in `tests/testing` because `testing-helper` was never compiled.
For a project this small, there's no real need to distinguish precisely
which tests need the helper: we can have a simpler build by just
assuming that they all do, like Autotools would.
Signed-off-by: Simon McVittie <smcv@collabora.com>
59 lines
1.1 KiB
Meson
59 lines
1.1 KiB
Meson
# Copyright 2019 Endless OS Foundation LLC
|
|
# Copyright 2019 Collabora Ltd.
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
libglnx_testlib = static_library(
|
|
'glnx-testlib',
|
|
'libglnx-testlib.c',
|
|
'libglnx-testlib.h',
|
|
dependencies : [
|
|
libglnx_dep,
|
|
libglnx_deps,
|
|
],
|
|
install : false,
|
|
)
|
|
libglnx_testlib_dep = declare_dependency(
|
|
dependencies : [
|
|
libglnx_dep,
|
|
libglnx_deps,
|
|
],
|
|
include_directories : include_directories('.'),
|
|
link_with : libglnx_testlib,
|
|
)
|
|
|
|
if get_option('tests')
|
|
testing_helper = executable(
|
|
'testing-helper',
|
|
'testing-helper.c',
|
|
dependencies : [
|
|
libglnx_dep,
|
|
libglnx_deps,
|
|
],
|
|
install : false,
|
|
)
|
|
|
|
test_names = [
|
|
'backports',
|
|
'errors',
|
|
'fdio',
|
|
'macros',
|
|
'shutil',
|
|
'testing',
|
|
'xattrs',
|
|
]
|
|
|
|
foreach test_name : test_names
|
|
exe = executable(test_name,
|
|
[
|
|
'test-libglnx-' + test_name + '.c',
|
|
],
|
|
dependencies: [
|
|
libglnx_dep,
|
|
libglnx_deps,
|
|
libglnx_testlib_dep,
|
|
],
|
|
)
|
|
test(test_name, exe, depends: testing_helper)
|
|
endforeach
|
|
endif
|