diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-08 14:04:59 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-17 12:57:25 +0200 |
commit | cbd33cb55757122e2c02356285c335af969dcd43 (patch) | |
tree | d57e3098209fa16ad97bff1f315eface2bacc708 /tests/auto/testlib/selftests | |
parent | fb3549fc47b19de2956cd2dda07ef67ec529cf3e (diff) |
Add missing dependencies of tests on their helper programs
This ensures that a command such as
$ ninja tst_qlocale && ninja tst_qlocale_check
will automagically build the syslocaleapp program that the test runs
from a subtest. Similar for testlib's selftests and tst_QProcess.
As a drive-by, pruned some legacy comments from when CMakeLists.txt
files were generated from .pro files.
Change-Id: I67691a8175aaef124d4104cf1898193993408bdf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests')
-rw-r--r-- | tests/auto/testlib/selftests/CMakeLists.txt | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt index 5ff460546d..2dd26211f2 100644 --- a/tests/auto/testlib/selftests/CMakeLists.txt +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -1,5 +1,4 @@ # The whole file is written manually. -# special case skip regeneration include(../../../../src/testlib/selfcover.cmake) @@ -14,7 +13,6 @@ qt_internal_add_test(tst_selftests catch.cpp PUBLIC_LIBRARIES Qt::TestPrivate - # special case begin # These lines need to be commented out as they need to be enabled # COMPILE_OPTIONS # conditionally @@ -24,7 +22,6 @@ qt_internal_add_test(tst_selftests # --cs-mcdc # LINK_OPTIONS # "$$COVERAGE_OPTIONS" - # special case end ) file(GLOB resource_glob_0 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "expected_*") @@ -41,26 +38,15 @@ qt_internal_add_resource(tst_selftests "qmake_expected_files" PREFIX "/" BASE - "${CMAKE_CURRENT_SOURCE_DIR}" # special case + "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${qmake_expected_files_resource_files} ) - -## Scopes: -##################################################################### - -#### Keys ignored in scope 5:.:.:test.pro:NOT ANDROID AND for(file,SUBPROGRAMS): -# TEST_HELPER_INSTALLS = "../$${file}/$${file}" - -#### Keys ignored in scope 7:.:..:../selftests.pri:TARGET Qt::Gui: -# SUBPROGRAMS = "keyboard" "mouse" - qt_internal_apply_testlib_coverage_options(tst_selftests) # ------------- Sub tests ------------- -# special case begin set(subprograms assert badxml @@ -131,6 +117,9 @@ add_definitions(-DQT_MESSAGELOGCONTEXT) foreach(subprogram IN LISTS subprograms) add_subdirectory(${subprogram}) + if(QT_FEATURE_process) + add_dependencies(tst_selftests ${subprogram}) + endif() endforeach() list(JOIN subprograms " " subprograms) @@ -138,16 +127,3 @@ qt_internal_extend_target(tst_selftests DEFINES $<$<COMPILE_LANGUAGE:CXX>:SUBPROGRAMS=${subprograms}> ) -# special case end - -#### Keys ignored in scope 1:.:.:test.pro:<TRUE>: -# CONFIG = "testcase" -# expected_files.base = "$$PWD/.." -# expected_files.files = "$$files$$PWD/../expected_*" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 5:.:.:test.pro:NOT ANDROID AND for(file,SUBPROGRAMS): -# TEST_HELPER_INSTALLS = "../$${file}/$${file}" -# special case end |