mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-14 03:24:50 -04:00
tests: Optionally skip building and running the actual tests
If we're building libglnx as a subproject in a larger project, we won't necessarily want to run these. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
9
meson_options.txt
Normal file
9
meson_options.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright 2022 Collabora Ltd.
|
||||
# SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
option(
|
||||
'tests',
|
||||
type : 'boolean',
|
||||
description : 'build and run unit tests',
|
||||
value : 'true',
|
||||
)
|
||||
@@ -21,24 +21,26 @@ libglnx_testlib_dep = declare_dependency(
|
||||
link_with : libglnx_testlib,
|
||||
)
|
||||
|
||||
test_names = [
|
||||
'errors',
|
||||
'fdio',
|
||||
'macros',
|
||||
'shutil',
|
||||
'xattrs',
|
||||
]
|
||||
if get_option('tests')
|
||||
test_names = [
|
||||
'errors',
|
||||
'fdio',
|
||||
'macros',
|
||||
'shutil',
|
||||
'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)
|
||||
endforeach
|
||||
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)
|
||||
endforeach
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user