From c1cf305be0f1f529b96a06dc70ce5ee7273006ef Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 18 Sep 2019 12:57:56 +0200 Subject: [PATCH] Don't create "gui" applications when linking against testlib In qmake land, testlib.pro has "console" in MODULE_CONFIG, so linking against testlib implicies CONFIG += console. The need for a console app is typically also covered by other cases, except in qtdeclarative's qqmldebugjsserver binary (and some others). They are not test helper binaries, they are not Qt tests themselves, but they must be console apps and due to their QT += testlib in the .pro they become console apps. So with cmake they also must be console apps so that the unit tests that launch them and read their stdout can pass. Change-Id: I687fdc910b550051750be74ecd176dd96626675c Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index c4e383c10d..28eb70454e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -2372,7 +2372,8 @@ def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, assert not is_example target = write_tool(cm_fh, scope, indent=indent) else: - gui = all(val not in config for val in ['console', 'cmdline']) + gui = all(val not in config for val in ['console', 'cmdline']) \ + and 'testlib' not in scope.expand('QT') if 'testcase' in config \ or 'testlib' in config \ or 'qmltestcase' in config: