cmake - CTest generate and submit gcov.tar to CDash after make <target> -
i have set cdash on local machine , i'm using ctest upload testing results cdash - generating .gcov-files containing branch coverage info , packing them gcov.tar beforehand (this modified version of example https://blog.kitware.com/additional-coverage-features-in-cdash/):
cmakelists.txt:
cmake_minimum_required(version 3.2) project(branch_coverage_example) add_executable(foo foo.cxx) include(ctest) add_test(name foo command foo) include(branchcoverage)
branchcoverage.cmake within cmake modules path:
if(${cmake_build_type} strequal "profiling") option(always_generate_branch_coverage_info "run gcov branch coverage part of target" on) if(always_generate_branch_coverage_info) add_custom_target(branchcoverage) add_custom_command(target branchcoverage post_build command ${cmake_ctest_command} -d experimentalsubmit -s cdash_tarball.cmake working_directory ${cmake_source_dir} comment "generating gcov.tar containing branch coverage info..." ) add_dependencies(branchcoverage experimental) endif() endif()
ctestconfig.cmake:
## file should placed in root directory of project. ## modify cmakelists.txt file in root directory of ## project incorporate testing dashboard. ## ## # following required submit cdash dashboard: ## enable_testing() ## include(ctest) set(ctest_project_name "branchcoverageexample") set(ctest_nightly_start_time "01:00:00 utc") set(ctest_drop_method "http") set(ctest_drop_site "localhost") set(ctest_drop_location "/cdash/public/submit.php?project=branchcoverageexample") set(ctest_drop_site_cdash true)
cdash_upload.cmake:
# start, configure, build, test, coverage , submit # have been executed make <target> beforehand! # generate gcov tarball , upload cdash. include(ctestcoveragecollectgcov) ctest_coverage_collect_gcov( tarball gcov.tar source ${ctest_source_directory} build ${ctest_binary_directory} gcov_command ${ctest_coverage_command} gcov_options -l -p -b ) if(exists "${ctest_binary_directory}/gcov.tar") ctest_submit(cdash_upload "${ctest_binary_directory}/gcov.tar" cdash_upload_type gcovtar) endif()
it works when invoke script example using ctest directly:
ctest -v -s run_example.cmake
this gives me wonderful branch coverage information in cdash. not:
make experimental
it ends saying:
generating gcov.tar containing branch coverage info... cmake error @ /usr/local/share/cmake-3.6/modules/ctestcoveragecollectgcov.cmake:118 (file): file strings file "/cmakefiles/targetdirectories.txt" cannot read. call stack (most recent call first): cdash_tarball.cmake:2 (ctest_coverage_collect_gcov) ctest_coverage_collect_gcov: no .gcda files found, ignoring coverage request.
i guess has paths/env vars need give cdash_upload.cmake, when using -dctest_source_directory @ add_custom_command in branchcoverage.cmake, cdash returns "bad http response", doesn't give me indication should fix , where.
do guys have idea? in advance!
Comments
Post a Comment