【问题标题】:Using CMake with CTest and CDash将 CMake 与 CTest 和 CDash 一起使用
【发布时间】:2010-08-23 07:47:08
【问题描述】:

我将在我的 C++ 项目中使用 CMake/CTest 和 Cdash。

为了启用 Cdash 和自定义设置,例如 “MEMORYCHECK_SUPPRESSIONS_FILE”“DART_TESTING_TIMEOUT”,我在根目录中添加了以下几行CMakeLists.txt

set(MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_SOURCE_DIR}/valgrind.supp") set(DART_TESTING_TIMEOUT "120") include(CTest)

但是,生成的 "DartConfiguration.tcl" 根本不包含我的设置 (MemoryCheckSuppressionFile 为空,TimeOut 仍为默认值)

我发现,例如,如果我通过 -DDART_TESTING_TIMEOUT=STRING:120 ,它可以工作,但如果在 CMakeLists.txt 中指定它们则会失败。

提前谢谢你:)

DartConfiguration.tcl

# Dynamic analisys and coverage PurifyCommand: ValgrindCommand: ValgrindCommandOptions: MemoryCheckCommand: /usr/bin/valgrind MemoryCheckCommandOptions: MemoryCheckSuppressionFile: CoverageCommand: /usr/bin/gcov # Testing options # TimeOut is the amount of time in seconds to wait for processes # to complete during testing. After TimeOut seconds, the # process will be summaily terminated. # Currently set to 25 -9.0.0.71596-0inutes TimeOut: 1500

【问题讨论】:

    标签: c++ cmake cdash


    【解决方案1】:

    有三种可能的解决方案:

    1. 您创建缓存变量。这也会为变量创建一个 GUI 条目,这并不总是您想要的自动测试:SET(DART_TESTING_TIMEOUT "120" CACHE STRING "")

    2. 您可以使用简单的“设置”命令指定选项,但在名为 DartConfig.cmake 的文件中而不是主 CMakeLists.txt 中。解析此文件以创建 DartConfiguration.tcl

    3. 您使用 CTest 脚本设置您的 dartclient:http://www.cmake.org/Wiki/CMake_Scripting_Of_CTest

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-13
      • 1970-01-01
      • 2022-01-24
      • 2017-10-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多