From b12084ef76f73757e254208dd55cf2018842ff15 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 25 Jun 2019 09:37:25 +1000 Subject: [PATCH] tools: skip debug-gui option testing if the debug-gui is disabled Fixes #311 Signed-off-by: Peter Hutterer --- meson.build | 8 +++++++- tools/test-tool-option-parsing.py | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e2af8a5..3523657 100644 --- a/meson.build +++ b/meson.build @@ -612,8 +612,14 @@ executable('ptraccel-debug', # Don't run the test during a release build because we rely on the magic # subtool lookup if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimized' + config_tool_option_test = configuration_data() + config_tool_option_test.set('MESON_ENABLED_DEBUG_GUI', get_option('debug-gui')) + tool_option_test = configure_file(input: 'tools/test-tool-option-parsing.py', + output: '@BASENAME@', + configuration : config_tool_option_test, + install : false) test('tool-option-parsing', - find_program('tools/test-tool-option-parsing.py'), + tool_option_test, args : ['--tool-path', libinput_tool.full_path()], suite : ['all', 'root'], timeout : 240) diff --git a/tools/test-tool-option-parsing.py b/tools/test-tool-option-parsing.py index 64a9ce0..594154e 100755 --- a/tools/test-tool-option-parsing.py +++ b/tools/test-tool-option-parsing.py @@ -206,6 +206,11 @@ class TestDebugGUI(TestToolWithOptions, TestLibinputTool): @classmethod def setUpClass(cls): + # This is set by meson + debug_gui_enabled = @MESON_ENABLED_DEBUG_GUI@ + if not debug_gui_enabled: + raise unittest.SkipTest() + if not os.getenv('DISPLAY') and not os.getenv('WAYLAND_DISPLAY'): raise unittest.SkipTest() -- 2.7.4