• <tfoot id='EFZD8'></tfoot>
  • <small id='EFZD8'></small><noframes id='EFZD8'>

      <i id='EFZD8'><tr id='EFZD8'><dt id='EFZD8'><q id='EFZD8'><span id='EFZD8'><b id='EFZD8'><form id='EFZD8'><ins id='EFZD8'></ins><ul id='EFZD8'></ul><sub id='EFZD8'></sub></form><legend id='EFZD8'></legend><bdo id='EFZD8'><pre id='EFZD8'><center id='EFZD8'></center></pre></bdo></b><th id='EFZD8'></th></span></q></dt></tr></i><div id='EFZD8'><tfoot id='EFZD8'></tfoot><dl id='EFZD8'><fieldset id='EFZD8'></fieldset></dl></div>
        <bdo id='EFZD8'></bdo><ul id='EFZD8'></ul>
      <legend id='EFZD8'><style id='EFZD8'><dir id='EFZD8'><q id='EFZD8'></q></dir></style></legend>

      1. 在 CMake/CDash 中使用 gcov 的详细指南?

        时间:2023-08-02
        <tfoot id='nmlcI'></tfoot>

              <tbody id='nmlcI'></tbody>
            <legend id='nmlcI'><style id='nmlcI'><dir id='nmlcI'><q id='nmlcI'></q></dir></style></legend>
          1. <small id='nmlcI'></small><noframes id='nmlcI'>

            <i id='nmlcI'><tr id='nmlcI'><dt id='nmlcI'><q id='nmlcI'><span id='nmlcI'><b id='nmlcI'><form id='nmlcI'><ins id='nmlcI'></ins><ul id='nmlcI'></ul><sub id='nmlcI'></sub></form><legend id='nmlcI'></legend><bdo id='nmlcI'><pre id='nmlcI'><center id='nmlcI'></center></pre></bdo></b><th id='nmlcI'></th></span></q></dt></tr></i><div id='nmlcI'><tfoot id='nmlcI'></tfoot><dl id='nmlcI'><fieldset id='nmlcI'></fieldset></dl></div>
                <bdo id='nmlcI'></bdo><ul id='nmlcI'></ul>

                1. 本文介绍了在 CMake/CDash 中使用 gcov 的详细指南?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在我的项目中使用 CMake,并为连续/夜间构建设置了一个 cdash 服务器.一切正常,通过设置 crontab,我们可以将每小时/每晚的构建/测试结果自动上传到我们的 cdash 服务器.

                  I'm using CMake with my project and set up a cdash server for continuous/nightly building. Everything works well and by setting up a crontab, we have hourly/nightly build/test results uploaded to our cdash server automatically.

                  我的下一步是将测试覆盖率报告添加到构建中.我在这里找到文档 http://www.cmake.org/Wiki/CTest:Coverage 但坦率地说,这离实用指南还差得很远.

                  My next step is to add test coverage report to the build. I find the document here http://www.cmake.org/Wiki/CTest:Coverage but frankly it's a bit far from a practical guide.

                  目前我已经添加了所需的标志(而不是 -fprofile-arcs -ftest-coverage,我发现 --coverage 更好),编译过程生成 ..gcno 文件.但后来我被卡住了.命令

                  Currently I've added the required flag (instead of -fprofile-arcs -ftest-coverage, I find --coverage better), the compilation process generates .gcno files. But then I'm stuck. The command

                  make NightlyCoverage
                  

                  好像什么都没做.谁能告诉我接下来要做什么?我想要的结果是通过执行 make NightlyCoverage,生成覆盖报告并上传到 cdash 服务器.

                  doesn't seem to do anything. Could anybody tell me what is the next to do? The result that I want, is by doing make NightlyCoverage, coverage reports are generated and uploaded to cdash server.

                  推荐答案

                  我一直在使用 https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake 成功.

                  I've been using https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake successfully.

                  只是按照指导方针:将文件添加到我的CMAKE_MODULE_PATH目录,添加

                  Just followed the guidelines: added the files to my CMAKE_MODULE_PATH directory, added

                  set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
                  if(CMAKE_COMPILER_IS_GNUCXX)
                      include(CodeCoverage)
                      setup_target_for_coverage(${PROJECT_NAME}_coverage ${PROJECT_TEST_NAME} coverage)
                  endif()
                  

                  在我的 CMakeLists.txt 中.我还手动添加了 gcov 作为目标的依赖项:

                  in my CMakeLists.txt. I also added manually gcov as a dependency for my target:

                  if(CMAKE_COMPILER_IS_GNUCXX)
                      target_link_libraries(${PROJECT_TEST_NAME} gcov)
                  endif()
                  

                  有了这个,我只需输入

                  make my_project_coverage
                  

                  然后我在构建树的 coverage 目录中获得了 html 报告.

                  and I get the html report in the coverage directory of my build tree.

                  这篇关于在 CMake/CDash 中使用 gcov 的详细指南?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何解决错误 LNK2019:未解析的外部符号 - 函数? 下一篇:测试 stdin 是否有 C++ 输入(windows 和/或 linux)

                  相关文章

                  最新文章

                  1. <i id='Ye5oS'><tr id='Ye5oS'><dt id='Ye5oS'><q id='Ye5oS'><span id='Ye5oS'><b id='Ye5oS'><form id='Ye5oS'><ins id='Ye5oS'></ins><ul id='Ye5oS'></ul><sub id='Ye5oS'></sub></form><legend id='Ye5oS'></legend><bdo id='Ye5oS'><pre id='Ye5oS'><center id='Ye5oS'></center></pre></bdo></b><th id='Ye5oS'></th></span></q></dt></tr></i><div id='Ye5oS'><tfoot id='Ye5oS'></tfoot><dl id='Ye5oS'><fieldset id='Ye5oS'></fieldset></dl></div>

                    <small id='Ye5oS'></small><noframes id='Ye5oS'>

                    <legend id='Ye5oS'><style id='Ye5oS'><dir id='Ye5oS'><q id='Ye5oS'></q></dir></style></legend>

                      <bdo id='Ye5oS'></bdo><ul id='Ye5oS'></ul>
                  2. <tfoot id='Ye5oS'></tfoot>