diff options
author | Simon McVittie <smcv@collabora.com> | 2022-04-21 18:33:18 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-04-21 19:44:13 +0100 |
commit | c500c362b85ad8119a6f07d91e47166c997753c9 (patch) | |
tree | 80d20215a85b4c22aecc75efd3e16cdae4c1ba72 /tests/meson.build | |
parent | eeea247ade9efc797d7aad88baa9e93742d9a9bf (diff) | |
download | libglnx-c500c362b85ad8119a6f07d91e47166c997753c9.tar.gz |
tests: Build libglnx-testlib as a separate static library
One of Flatpak's unit tests uses this, for _GLNX_TEST_SCOPED_TEMP_DIR.
Its API is not really stable, but libglnx is a "copylib" anyway, so
none of it has (or needs) a strictly stable API.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'tests/meson.build')
-rw-r--r-- | tests/meson.build | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/meson.build b/tests/meson.build index 2ad8c44..555009f 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -2,6 +2,25 @@ # 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, +) + test_names = [ 'errors', 'fdio', @@ -13,13 +32,12 @@ test_names = [ foreach test_name : test_names exe = executable(test_name, [ - 'libglnx-testlib.c', - 'libglnx-testlib.h', 'test-libglnx-' + test_name + '.c', ], dependencies: [ libglnx_dep, libglnx_deps, + libglnx_testlib_dep, ], ) test(test_name, exe) |