diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2018-02-06 15:44:52 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2018-02-07 13:08:01 +0000 |
commit | 7d9598740374db338687b9c3d2d6fb7d89b6ae67 (patch) | |
tree | 8d053a9ca3c0304b8c9ffb82c116866e09642723 /qtivi.pro | |
parent | 0448ec8f0cb3fb52d41e156c2ec15fcff225d2f9 (diff) |
Add a easy way to do a test-coverage run
This is inspired by QtApplicationManagers version, but adapted for
qtivi and it's autogeneration.
Change-Id: I8880e277646f66b976787739e56206044577560a
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'qtivi.pro')
-rw-r--r-- | qtivi.pro | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -21,4 +21,38 @@ load(qt_parts) SUBDIRS += mkspecs mkspecs.depends = sub_src +GCOV_EXCLUDE = /usr/* \ + $$[QT_INSTALL_PREFIX]/* \ + $$[QT_INSTALL_PREFIX/src]/* \ + $$_PRO_FILE_PWD_/tests/* \ + $$OUT_PWD/*/.moc/* \ + $$OUT_PWD/*/.rcc/* \ + $$OUT_PWD/*/.uic/* \ + $$OUT_PWD/tests/* \ + $$OUT_PWD/examples/* \ + $$_PRO_FILE_PWD_/examples/* \ + + +!prefix_build: GCOV_EXCLUDE += $$clean_path($$[QT_INSTALL_PREFIX]/../*) $$clean_path($$[QT_INSTALL_PREFIX/src]/../*) + +for (f, GCOV_EXCLUDE) { + GCOV_EXCLUDE_STR += $$shell_quote($$f) +} + +global-check-coverage.target = check-coverage +global-check-coverage.depends = coverage +global-check-coverage.commands = ( \ + find . -name \"*.gcov-info\" -print0 | xargs -0 rm -f && \ + lcov -c -i -d . --rc lcov_branch_coverage=1 --rc geninfo_auto_base=1 -o $$OUT_PWD/base.gcov-info && \ + cd tests && make check && cd .. && \ + lcov -c -d . --rc lcov_branch_coverage=1 --rc geninfo_auto_base=1 -o $$OUT_PWD/test.gcov-info && \ + lcov --rc lcov_branch_coverage=1 -o $$OUT_PWD/temp.gcov-info `find . -name \"*.gcov-info\" | xargs -n1 echo -a` && \ + lcov --rc lcov_branch_coverage=1 -o $$OUT_PWD/qtivi.gcov-info -r temp.gcov-info $$GCOV_EXCLUDE_STR && \ + rm -f base.gcov-info test.gcov-info temp.gcov-info && \ + genhtml -o branch-coverage -s -f --legend --branch-coverage --rc lcov_branch_coverage=1 --demangle-cpp qtivi.gcov-info && echo \"\\n\\nCoverage info is available at file://`pwd`/branch-coverage/index.html\" \ +) + +QMAKE_EXTRA_TARGETS -= sub-check-coverage +QMAKE_EXTRA_TARGETS *= global-check-coverage + OTHER_FILES += sync.profile |