summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2024-02-27 10:37:10 +0100
committerDominik Holland <dominik.holland@qt.io>2024-02-28 08:42:52 +0000
commitb648926ff4434e1f27d10dc661946fb3d16898fa (patch)
tree7912e2677f31b97a1219ddd2c31699424f5d5f64 /CMakeLists.txt
parent0e1a777f01bd0416e9a33e0d824c6aae462368ba (diff)
coin: Improve the code coverage setup
* Set AM_TIMEOUT_FACTOR * Retry tests up to 3 times if they fail * Create a zip of the coverage-report folder * Exclude some more files Change-Id: I23d2e67bf4e7c192ce024e4c6602d531823d9ed4 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2c90733..e1dca564 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,9 +86,10 @@ if(AM_COVERAGE)
)
if(QT_BUILD_STANDALONE_TESTS)
- # this is currently hard-coded for Coin's standalone tests
+ # Coin splits the build into two separate directories, so we need to merge the coverage info
set(GCOV_EXTRA_FOLDER "../qtapplicationmanager_build")
set(LCOV_EXTRA_ARGS -d ${GCOV_EXTRA_FOLDER})
+ list(APPEND GCOV_EXCLUDE '/home/qt/work/qt/qtapplicationmanager_build/*')
endif()
set(COVERAGE_DEPENDS all)
if(QT_WILL_INSTALL)
@@ -100,7 +101,7 @@ if(AM_COVERAGE)
COMMAND sh -c 'which genhtml >/dev/null || { echo "The genhtml tool is not available." && exit 2 \; }'
COMMAND find . \\\( -name \"*.gcov-info\" -o -name \"*.gcda\" \\\) -print0 | xargs -0 rm -f
COMMAND lcov -keep-going -c -i -d . ${LCOV_EXTRA_ARGS} --rc branch_coverage=1 --rc geninfo_auto_base=1 -o "${CMAKE_CURRENT_BINARY_DIR}/base.gcov-info"
- COMMAND ctest --test-dir tests/auto --verbose
+ COMMAND ctest --test-dir tests/auto --verbose --repeat until-pass:3
COMMAND lcov -keep-going -c -d . ${LCOV_EXTRA_ARGS} --rc branch_coverage=1 --rc geninfo_auto_base=1 -o "${CMAKE_CURRENT_BINARY_DIR}/test.gcov-info"
COMMAND lcov -keep-going --rc branch_coverage=1 -o "${CMAKE_CURRENT_BINARY_DIR}/temp.gcov-info" `find . ${GCOV_EXTRA_FOLDER} -name \"*.gcov-info\" | xargs -n1 echo -a`
COMMAND lcov -keep-going --rc branch_coverage=1 -o "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.gcov-info" -r temp.gcov-info ${GCOV_EXCLUDE}