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 <alexandru.croitor@qt.io>
This commit is contained in:
Simon Hausmann 2019-09-18 12:57:56 +02:00
parent 655b2ed90c
commit c1cf305be0

View File

@ -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: