CMake: Enable testlib selftests

This patch adds the equivalent of testlib's selfcover.pri and is enabled
for both testlib and the respective selftests test.

This patch also fixes the selftests so that they can run without
FEATURE_testlib_selfcover enabled.

Change-Id: I15913de2d572ac79804ce3e652cee66de74318f8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2020-03-17 11:15:10 +01:00
parent 64bda9d915
commit dfd37e27ca
63 changed files with 369 additions and 342 deletions

View File

@ -1,5 +1,9 @@
# Generated from testlib.pro.
# special case begin
include(selfcover.cmake)
# special case end
#####################################################################
## Test Module:
#####################################################################
@ -130,3 +134,6 @@ qt_add_docs(Test
doc/qttestlib.qdocconf
)
# special case begin
qt_apply_testlib_coverage_options(Test)
# special case end

View File

@ -0,0 +1,40 @@
#
# Hand crafted file based on selfcover.pri
#
# Overwrite CMake compiler
function(__qt_testlib_patch_compiler_name variable)
get_filename_component(name ${${variable}} NAME)
set(${variable} cs${name} PARENT_SCOPE)
endfunction()
if (FEATURE_testlib_selfcover)
__qt_testlib_patch_compiler_name(CMAKE_C_COMPILER)
__qt_testlib_patch_compiler_name(CMAKE_CXX_COMPILER)
__qt_testlib_patch_compiler_name(CMAKE_CXX_COMPILER_AR)
__qt_testlib_patch_compiler_name(CMAKE_CXX_COMPILER_RANLIB)
endif()
# This enables verification that testlib itself is adequately tested,
# as a grounds for trusting that testing with it is useful.
function(qt_apply_testlib_coverage_options target)
if (NOT FEATURE_testlib_selfcover)
return()
endif()
# Exclude all non-testlib source from coverage instrumentation:
set(testlib_coverage_options
--cs-exclude-file-abs-wildcard="${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/*"
--cs-include-file-abs-wildcard="*/src/testlib/*"
--cs-mcc # enable Multiple Condition Coverage
--cs-mcdc # enable Multiple Condition / Decision Coverage
# (recommended for ISO 26262 ASIL A, B and C -- highly recommended for ASIL D)
# https://doc.froglogic.com/squish-coco/4.1/codecoverage.html#sec%3Amcdc
)
target_compile_options(${target} PRIVATE
${testlib_coverage_options}
)
target_link_options(${target} PRIVATE
${testlib_coverage_options}
)
endfunction()

View File

@ -2,7 +2,7 @@
# add_subdirectory(outformat) # special case missing project
add_subdirectory(qsignalspy)
# add_subdirectory(selftests) # special case disable because the conversion is broken and hard to fix atm
add_subdirectory(selftests)
if(TARGET Qt::Widgets)
add_subdirectory(qabstractitemmodeltester)
endif()

View File

@ -1,9 +1,3 @@
# Generated from selftests.pro.
add_subdirectory(test)
if(NOT WINRT)
if(TARGET Qt::Gui)
endif()
endif()

View File

@ -1,6 +1,18 @@
# Generated from selftests.pro.
# special case begin
include(../../../../src/testlib/selfcover.cmake)
# special case end
add_subdirectory(test)
if(NOT WINRT)
if(TARGET Qt::Gui)
endif()
endif()
# special case begin
# The whole file is written manually.
if(NOT WINRT)
@ -36,6 +48,7 @@ if(NOT WINRT)
add_subdirectory(longstring)
add_subdirectory(maxwarnings)
add_subdirectory(multiexec)
add_subdirectory(pass)
add_subdirectory(pairdiagnostics)
add_subdirectory(printdatatags)
add_subdirectory(printdatatagswithglobaltags)
@ -65,338 +78,6 @@ if(NOT WINRT)
endif()
endif()
#####################################################################
## tst_selftests Test:
#####################################################################
add_qt_test(tst_selftests
SOURCES
../../../shared/emulationdetector.h
tst_selftests.cpp
INCLUDE_DIRECTORIES
../../../shared
LIBRARIES
Qt::TestPrivate
)
add_qt_resource(tst_selftests "expected_files" PREFIX "/" FILES
expected_assert.lightxml
expected_assert.tap
expected_assert.teamcity
expected_assert.txt
expected_assert.xml
expected_assert.xunitxml
expected_badxml.lightxml
expected_badxml.tap
expected_badxml.teamcity
expected_badxml.txt
expected_badxml.xml
expected_badxml.xunitxml
expected_benchlibcallgrind_0.txt
expected_benchlibcallgrind_1.txt
expected_benchlibcallgrind.csv
expected_benchlibcallgrind.lightxml
expected_benchlibcallgrind.tap
expected_benchlibcallgrind.teamcity
expected_benchlibcallgrind.xml
expected_benchlibcallgrind.xunitxml
expected_benchlibcounting.csv
expected_benchlibcounting.lightxml
expected_benchlibcounting.tap
expected_benchlibcounting.teamcity
expected_benchlibcounting.txt
expected_benchlibcounting.xml
expected_benchlibcounting.xunitxml
expected_benchlibeventcounter.csv
expected_benchlibeventcounter.lightxml
expected_benchlibeventcounter.tap
expected_benchlibeventcounter.teamcity
expected_benchlibeventcounter.txt
expected_benchlibeventcounter.xml
expected_benchlibeventcounter.xunitxml
expected_benchliboptions.csv
expected_benchliboptions.lightxml
expected_benchliboptions.tap
expected_benchliboptions.teamcity
expected_benchliboptions.txt
expected_benchliboptions.xml
expected_benchliboptions.xunitxml
expected_benchlibtickcounter.csv
expected_benchlibtickcounter.lightxml
expected_benchlibtickcounter.tap
expected_benchlibtickcounter.teamcity
expected_benchlibtickcounter.txt
expected_benchlibtickcounter.xml
expected_benchlibtickcounter.xunitxml
expected_benchlibwalltime.csv
expected_benchlibwalltime.lightxml
expected_benchlibwalltime.tap
expected_benchlibwalltime.teamcity
expected_benchlibwalltime.txt
expected_benchlibwalltime.xml
expected_benchlibwalltime.xunitxml
expected_blacklisted.lightxml
expected_blacklisted.tap
expected_blacklisted.teamcity
expected_blacklisted.txt
expected_blacklisted.xml
expected_blacklisted.xunitxml
expected_cmptest.lightxml
expected_cmptest.tap
expected_cmptest.teamcity
expected_cmptest.txt
expected_cmptest.xml
expected_cmptest.xunitxml
expected_commandlinedata.lightxml
expected_commandlinedata.tap
expected_commandlinedata.teamcity
expected_commandlinedata.txt
expected_commandlinedata.xml
expected_commandlinedata.xunitxml
expected_counting.lightxml
expected_counting.tap
expected_counting.teamcity
expected_counting.txt
expected_counting.xml
expected_counting.xunitxml
expected_crashes_1.txt
expected_crashes_2.txt
expected_crashes_3.txt
expected_crashes_4.txt
expected_crashes_5.txt
expected_datatable.lightxml
expected_datatable.tap
expected_datatable.teamcity
expected_datatable.txt
expected_datatable.xml
expected_datatable.xunitxml
expected_datetime.lightxml
expected_datetime.tap
expected_datetime.teamcity
expected_datetime.txt
expected_datetime.xml
expected_datetime.xunitxml
expected_differentexec.lightxml
expected_differentexec.tap
expected_differentexec.teamcity
expected_differentexec.txt
expected_differentexec.xml
expected_differentexec.xunitxml
expected_exceptionthrow.lightxml
expected_exceptionthrow.tap
expected_exceptionthrow.teamcity
expected_exceptionthrow.txt
expected_exceptionthrow.xml
expected_exceptionthrow.xunitxml
expected_expectfail.lightxml
expected_expectfail.tap
expected_expectfail.teamcity
expected_expectfail.txt
expected_expectfail.xml
expected_expectfail.xunitxml
expected_failcleanup.lightxml
expected_failcleanup.tap
expected_failcleanup.teamcity
expected_failcleanup.txt
expected_failcleanup.xml
expected_failcleanup.xunitxml
expected_faildatatype.lightxml
expected_faildatatype.tap
expected_faildatatype.teamcity
expected_faildatatype.txt
expected_faildatatype.xml
expected_faildatatype.xunitxml
expected_failfetchtype.lightxml
expected_failfetchtype.tap
expected_failfetchtype.teamcity
expected_failfetchtype.txt
expected_failfetchtype.xml
expected_failfetchtype.xunitxml
expected_failinitdata.lightxml
expected_failinitdata.tap
expected_failinitdata.teamcity
expected_failinitdata.txt
expected_failinitdata.xml
expected_failinitdata.xunitxml
expected_failinit.lightxml
expected_failinit.tap
expected_failinit.teamcity
expected_failinit.txt
expected_failinit.xml
expected_failinit.xunitxml
expected_fetchbogus.lightxml
expected_fetchbogus.tap
expected_fetchbogus.teamcity
expected_fetchbogus.txt
expected_fetchbogus.xml
expected_fetchbogus.xunitxml
expected_findtestdata.lightxml
expected_findtestdata.tap
expected_findtestdata.teamcity
expected_findtestdata.txt
expected_findtestdata.xml
expected_findtestdata.xunitxml
expected_float.lightxml
expected_float.tap
expected_float.teamcity
expected_float.txt
expected_float.xml
expected_float.xunitxml
expected_globaldata.lightxml
expected_globaldata.tap
expected_globaldata.teamcity
expected_globaldata.txt
expected_globaldata.xml
expected_globaldata.xunitxml
expected_keyboard.lightxml
expected_keyboard.tap
expected_keyboard.teamcity
expected_keyboard.txt
expected_keyboard.xml
expected_keyboard.xunitxml
expected_longstring.lightxml
expected_longstring.tap
expected_longstring.teamcity
expected_longstring.txt
expected_longstring.xml
expected_longstring.xunitxml
expected_maxwarnings.lightxml
expected_maxwarnings.tap
expected_maxwarnings.teamcity
expected_maxwarnings.txt
expected_maxwarnings.xml
expected_maxwarnings.xunitxml
expected_multiexec.lightxml
expected_multiexec.tap
expected_multiexec.teamcity
expected_multiexec.txt
expected_multiexec.xml
expected_multiexec.xunitxml
expected_pairdiagnostics.lightxml
expected_pairdiagnostics.tap
expected_pairdiagnostics.teamcity
expected_pairdiagnostics.txt
expected_pairdiagnostics.xml
expected_pairdiagnostics.xunitxml
expected_printdatatags.txt
expected_printdatatagswithglobaltags.txt
expected_qexecstringlist.lightxml
expected_qexecstringlist.tap
expected_qexecstringlist.teamcity
expected_qexecstringlist.txt
expected_qexecstringlist.xml
expected_qexecstringlist.xunitxml
expected_signaldumper.lightxml
expected_signaldumper.tap
expected_signaldumper.teamcity
expected_signaldumper.txt
expected_signaldumper.xml
expected_signaldumper.xunitxml
expected_silent.lightxml
expected_silent.tap
expected_silent.teamcity
expected_silent.txt
expected_silent.xml
expected_silent.xunitxml
expected_singleskip.lightxml
expected_singleskip.tap
expected_singleskip.teamcity
expected_singleskip.txt
expected_singleskip.xml
expected_singleskip.xunitxml
expected_skipcleanup.lightxml
expected_skipcleanup.tap
expected_skipcleanup.teamcity
expected_skipcleanup.txt
expected_skipcleanup.xml
expected_skipcleanup.xunitxml
expected_skipinitdata.lightxml
expected_skipinitdata.tap
expected_skipinitdata.teamcity
expected_skipinitdata.txt
expected_skipinitdata.xml
expected_skipinitdata.xunitxml
expected_skipinit.lightxml
expected_skipinit.tap
expected_skipinit.teamcity
expected_skipinit.txt
expected_skipinit.xml
expected_skipinit.xunitxml
expected_skip.lightxml
expected_skip.tap
expected_skip.teamcity
expected_skip.txt
expected_skip.xml
expected_skip.xunitxml
expected_sleep.lightxml
expected_sleep.tap
expected_sleep.teamcity
expected_sleep.txt
expected_sleep.xml
expected_sleep.xunitxml
expected_strcmp.lightxml
expected_strcmp.tap
expected_strcmp.teamcity
expected_strcmp.txt
expected_strcmp.xml
expected_strcmp.xunitxml
expected_subtest.lightxml
expected_subtest.tap
expected_subtest.teamcity
expected_subtest.txt
expected_subtest.xml
expected_subtest.xunitxml
expected_testlib.lightxml
expected_testlib.tap
expected_testlib.teamcity
expected_testlib.txt
expected_testlib.xml
expected_testlib.xunitxml
expected_tuplediagnostics.lightxml
expected_tuplediagnostics.tap
expected_tuplediagnostics.teamcity
expected_tuplediagnostics.txt
expected_tuplediagnostics.xml
expected_tuplediagnostics.xunitxml
expected_verbose1.lightxml
expected_verbose1.tap
expected_verbose1.teamcity
expected_verbose1.txt
expected_verbose1.xml
expected_verbose1.xunitxml
expected_verbose2.lightxml
expected_verbose2.tap
expected_verbose2.teamcity
expected_verbose2.txt
expected_verbose2.xml
expected_verbose2.xunitxml
expected_verifyexceptionthrown.lightxml
expected_verifyexceptionthrown.tap
expected_verifyexceptionthrown.teamcity
expected_verifyexceptionthrown.txt
expected_verifyexceptionthrown.xml
expected_verifyexceptionthrown.xunitxml
expected_warnings.lightxml
expected_warnings.tap
expected_warnings.teamcity
expected_warnings.txt
expected_warnings.xml
expected_warnings.xunitxml
expected_watchdog.lightxml
expected_watchdog.tap
expected_watchdog.teamcity
expected_watchdog.txt
expected_watchdog.xml
expected_watchdog.xunitxml
expected_xunit.lightxml
expected_xunit.tap
expected_xunit.teamcity
expected_xunit.txt
expected_xunit.xml
expected_xunit.xunitxml
)
#### Keys ignored in scope 1:.:.:test.pro:<TRUE>:
# CONFIG = "testcase"
# expected_files.base = "$$PWD/.."
@ -407,5 +88,4 @@ add_qt_resource(tst_selftests "expected_files" PREFIX "/" FILES
#### Keys ignored in scope 5:.:.:test.pro:NOT ANDROID AND NOT WINRT AND for(file,SUBPROGRAMS):
# TEST_HELPER_INSTALLS = "../$${file}/$${file}"
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(assert
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(assert)
# special case end

View File

@ -16,3 +16,7 @@ add_qt_executable(badxml
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(badxml)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(benchlibcallgrind
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(benchlibcallgrind)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(benchlibcounting
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(tst_selftests)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(benchlibeventcounter
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(benchlibeventcounter)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(benchliboptions
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(tst_selftests)
# special case end

View File

@ -16,3 +16,7 @@ add_qt_executable(benchlibtickcounter
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(benchlibtickcounter)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(benchlibwalltime
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(benchlibwalltime)
# special case end

View File

@ -16,3 +16,7 @@ add_qt_executable(blacklisted
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(blacklisted)
# special case end

View File

@ -20,3 +20,7 @@ extend_target(cmptest CONDITION TARGET Qt::Gui
PUBLIC_LIBRARIES
Qt::Gui
)
# special case begin
qt_apply_testlib_coverage_options(cmptest)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(commandlinedata
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(commandlinedata)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(counting
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(counting)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(crashes
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(crashes)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(datatable
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(datatable)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(datetime
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(datetime)
# special case end

View File

@ -12,3 +12,7 @@ add_qt_executable(deleteLater
PUBLIC_LIBRARIES
Qt::Test
)
# special case begin
qt_apply_testlib_coverage_options(deleteLater)
# special case end

View File

@ -12,3 +12,7 @@ add_qt_executable(deleteLater_noApp
PUBLIC_LIBRARIES
Qt::Test
)
# special case begin
qt_apply_testlib_coverage_options(deleteLater_noApp)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(differentexec
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(differentexec)
# special case end

View File

@ -16,3 +16,7 @@ add_qt_executable(exceptionthrow
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(exceptionthrow)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(expectfail
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(expectfail)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(failcleanup
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(failcleanup)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(faildatatype
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(faildatatype)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(failfetchtype
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(failfetchtype)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(failinit
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(failinit)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(failinitdata
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(failinitdata)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(fetchbogus
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(fetchbogus)
# special case end

View File

@ -28,3 +28,7 @@ add_qt_resource(findtestdata "findtestdata"
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(findtestdata)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(float
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(float)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(globaldata
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(globaldata)
# special case end

View File

@ -18,3 +18,7 @@ add_qt_executable(keyboard
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(keyboard)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(longstring
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(longstring)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(maxwarnings
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(maxwarnings)
# special case end

View File

@ -18,3 +18,7 @@ add_qt_executable(mouse
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(mouse)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(multiexec
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(multiexec)
# special case end

View File

@ -12,3 +12,7 @@ add_qt_executable(pairdiagnostics
PUBLIC_LIBRARIES
Qt::Test
)
# special case begin
qt_apply_testlib_coverage_options(pairdiagnostics)
# special case end

View File

@ -0,0 +1,21 @@
# Generated from pass.pro.
#####################################################################
## pass Binary:
#####################################################################
qt_add_executable(pass
NO_INSTALL # special case
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" # special case
SOURCES
tst_pass.cpp
PUBLIC_LIBRARIES
Qt::Test
)
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(pass)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(printdatatags
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(printdatatags)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(printdatatagswithglobaltags
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(printdatatagswithglobaltags)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(qexecstringlist
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(qexecstringlist)
# special case end

View File

@ -16,3 +16,7 @@ add_qt_executable(signaldumper
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(signaldumper)
# special case end

View File

@ -16,3 +16,7 @@ add_qt_executable(silent
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(silent)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(singleskip
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(singleskip)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(skip
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(skip)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(skipcleanup
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(skipcleanup)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(skipinit
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(skipinit)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(skipinitdata
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(skipinitdata)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(sleep
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(sleep)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(strcmp
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(strcmp)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(subtest
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(subtest)
# special case end

View File

@ -0,0 +1,61 @@
# Generated from test.pro.
#####################################################################
## tst_selftests Test:
#####################################################################
qt_add_test(tst_selftests
GUI
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../"
SOURCES
../../../../shared/emulationdetector.h
../tst_selftests.cpp
INCLUDE_DIRECTORIES
../../../../shared
PUBLIC_LIBRARIES
Qt::TestPrivate
# special case begin
# These lines need to be commented out as they need to be enabled
# COMPILE_OPTIONS
# conditionally
# --cs-exclude-file-abs-wildcard=${QT_SOURCE_TREE}/*
# --cs-include-file-abs-wildcard=*/src/testlib/*
# --cs-mcc
# --cs-mcdc
# LINK_OPTIONS
# "$$COVERAGE_OPTIONS"
# special case end
)
file(GLOB resource_glob_0 RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "../expected_*")
foreach(file IN LISTS resource_glob_0)
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/${file}" PROPERTIES QT_RESOURCE_ALIAS "${file}")
endforeach()
# Resources:
set(qmake_expected_files_resource_files
${resource_glob_0}
)
qt_add_resource(tst_selftests "qmake_expected_files"
PREFIX
"/"
BASE
"${CMAKE_CURRENT_SOURCE_DIR}" # special case
FILES
${qmake_expected_files_resource_files}
)
## Scopes:
#####################################################################
#### Keys ignored in scope 5:.:.:test.pro:NOT ANDROID AND NOT WINRT AND for(file,SUBPROGRAMS):
# TEST_HELPER_INSTALLS = "../$${file}/$${file}"
#### Keys ignored in scope 7:.:..:../selftests.pri:TARGET Qt::Gui:
# SUBPROGRAMS = "keyboard" "mouse"
# special case begin
qt_apply_testlib_coverage_options(tst_selftests)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(testlib
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(testlib)
# special case end

View File

@ -12,3 +12,7 @@ add_qt_executable(tuplediagnostics
PUBLIC_LIBRARIES
Qt::Test
)
# special case begin
qt_apply_testlib_coverage_options(tuplediagnostics)
# special case end

View File

@ -10,10 +10,14 @@ add_qt_executable(verbose1
SOURCES
../counting/tst_counting.cpp
DEFINES
TESTLIB_VERBOSITY_ARG="-v1"
TESTLIB_VERBOSITY_ARG=-v1 # special case remove quotes
PUBLIC_LIBRARIES
Qt::Test
)
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(verbose1)
# special case end

View File

@ -10,10 +10,14 @@ add_qt_executable(verbose2
SOURCES
../counting/tst_counting.cpp
DEFINES
TESTLIB_VERBOSITY_ARG="-v2"
TESTLIB_VERBOSITY_ARG=-v2 # special case remove quotes
PUBLIC_LIBRARIES
Qt::Test
)
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(verbose2)
# special case end

View File

@ -16,3 +16,7 @@ add_qt_executable(verifyexceptionthrown
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(verifyexceptionthrown)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(warnings
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(warnings)
# special case end

View File

@ -20,3 +20,7 @@ add_qt_executable(watchdog
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(watchdog)
# special case end

View File

@ -15,3 +15,7 @@ add_qt_executable(xunit
## Scopes:
#####################################################################
# special case begin
qt_apply_testlib_coverage_options(xunit)
# special case end