Add missing implicit dependencies to the tool tests

moc, qmake, rcc, and uic tests execute corresponding tools inside
the test executables. This adds dependencies explicitly, to execute
tests using _check targets, without the need to manually build
dependencies.

Pick-to: 6.3 6.2
Fixes: QTBUG-98576
Change-Id: I8b989276e21199b867591f7b0f6af9204695ac13
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Alexey Edelev 2022-02-07 18:07:56 +01:00
parent 1ff8877ea7
commit ba48e1b809
4 changed files with 34 additions and 11 deletions

View File

@ -143,3 +143,9 @@ add_custom_command(TARGET tst_moc
--collect-json "@${moc_json_out}"
COMMENT "Running moc with --collect-json"
)
# Add dependencies that are implicitly used inside the test
add_dependencies(tst_moc
Qt::qtpaths
Qt::moc
)

View File

@ -1,9 +1,3 @@
# Generated from qmake.pro.
#####################################################################
## tst_qmake Test:
#####################################################################
# Collect test data
file(GLOB_RECURSE test_data_glob
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
@ -17,8 +11,21 @@ qt_internal_add_test(tst_qmake
TESTDATA ${test_data}
)
## Scopes:
#####################################################################
#### Keys ignored in scope 2:.:.:qmake.pro:WIN32:
# testcase.timeout = "900"
set(dependencies
Qt::moc
Qt::qmake
)
if(TARGET Qt::Gui)
list(APPEND dependencies Qt::Gui)
endif()
if(TARGET Qt::Widgets)
list(APPEND dependencies Qt::Widgets)
endif()
if(TARGET Qt::rcc)
list(APPEND dependencies Qt::rcc)
endif()
if(TARGET Qt::uic)
list(APPEND dependencies Qt::uic)
endif()
# Add dependencies that are implicitly used inside the test
add_dependencies(tst_qmake ${dependencies})

View File

@ -63,3 +63,8 @@ qt_internal_add_resource(tst_rcc "size-1"
FILES
${size-1_resource_files}
)
# Add dependencies that are implicitly used inside the test
add_dependencies(tst_rcc
Qt::rcc
)

View File

@ -8,3 +8,8 @@ qt_internal_add_test(tst_uic
SOURCES
tst_uic.cpp
)
# Add dependencies that are implicitly used inside the test
add_dependencies(tst_uic
Qt::uic
)