[PATCH libinput] meson.build: always build some tests
Peter Hutterer
peter.hutterer at who-t.net
Thu Jun 14 04:52:33 UTC 2018
Make the meson -Dtests=false option only apply to the libinput test suite
itself which has extra dependencies, etc. The build tests and symbol leak
tests should always run.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Side-effect: we can now ninja test as root in a CI container and it does
something useful. Previously either it would fall over because /dev is
missing or we just disabled too much to make it worthwhile.
meson.build | 66 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 34 insertions(+), 32 deletions(-)
diff --git a/meson.build b/meson.build
index 59fd3cad..fd6dcbb4 100644
--- a/meson.build
+++ b/meson.build
@@ -657,6 +657,40 @@ executable('ptraccel-debug',
############ tests ############
+test_symbols_leak = find_program('test/symbols-leak-test.in')
+test('symbols-leak-test',
+ test_symbols_leak,
+ args : [ meson.current_source_dir() ])
+
+# build-test only
+executable('test-build-pedantic',
+ 'test/build-pedantic.c',
+ dependencies : [dep_udev],
+ include_directories : [includes_src, includes_include],
+ c_args : ['-std=c99', '-pedantic', '-Werror'],
+ install : false)
+# build-test only
+executable('test-build-std-gnuc90',
+ 'test/build-pedantic.c',
+ dependencies : [dep_udev],
+ include_directories : [includes_src, includes_include],
+ c_args : ['-std=gnu90', '-Werror'],
+ install : false)
+# test for linking with the minimal linker flags
+executable('test-build-linker',
+ 'test/build-pedantic.c',
+ include_directories : [includes_src, includes_include],
+ dependencies : [ dep_libinput, dep_libinput_util ],
+ install : false)
+# test including from C++
+executable('test-build-cxx',
+ 'test/build-cxx.cc',
+ dependencies : [dep_udev],
+ include_directories : [includes_src, includes_include],
+ install : false)
+
+# This is the test suite runner, we allow disabling that one because of
+# dependencies
if get_option('tests')
dep_check = dependency('check', version : '>= 0.9.10')
valgrind = find_program('valgrind')
@@ -813,11 +847,6 @@ if get_option('tests')
install : false)
test('test-litest-selftest', test_litest_selftest)
- test_symbols_leak = find_program('test/symbols-leak-test.in')
- test('symbols-leak-test',
- test_symbols_leak,
- args : [ meson.current_source_dir() ])
-
libinput_test_runner_sources = lib_litest_sources + [
'src/libinput-util.h',
'src/libinput-util.c',
@@ -851,33 +880,6 @@ if get_option('tests')
libinput_test_runner,
timeout : 1200)
- # build-test only
- executable('test-build-pedantic',
- 'test/build-pedantic.c',
- dependencies : [dep_udev],
- include_directories : [includes_src, includes_include],
- c_args : ['-std=c99', '-pedantic', '-Werror'],
- install : false)
- # build-test only
- executable('test-build-std-gnuc90',
- 'test/build-pedantic.c',
- dependencies : [dep_udev],
- include_directories : [includes_src, includes_include],
- c_args : ['-std=gnu90', '-Werror'],
- install : false)
- # test for linking with the minimal linker flags
- executable('test-build-linker',
- 'test/build-pedantic.c',
- include_directories : [includes_src, includes_include],
- dependencies : [ dep_libinput, dep_libinput_util ],
- install : false)
- # test including from C++
- executable('test-build-cxx',
- 'test/build-cxx.cc',
- dependencies : [dep_udev],
- include_directories : [includes_src, includes_include],
- install : false)
-
valgrind_env = environment()
valgrind_env.set('CK_FORK', 'no')
valgrind_env.set('USING_VALGRIND', '1')
--
2.14.4
More information about the wayland-devel
mailing list