8
我在CMake中有一個C++項目,我已經實現了單元測試(使用GoogleTest)以及集成測試,即執行應用程序並使用正則表達式檢查結果。如何使用CMake測試C++應用程序沒有內存錯誤?
add_test(NAME MyAppIntegration.testRefitRunMse COMMAND my_application "--refit=true")
set_tests_properties(MyAppIntegration.testRefitRunMse PROPERTIES PASS_REGULAR_EXPRESSION "mse\\=1\\.53611e\\-05")
現在我想要做同樣的事情,但運行應用程序來檢測內存錯誤,例如只需運行./my_application
並使用valgrind檢查內存錯誤。我怎樣才能做到這一點?請注意,我知道ctest -D ExperimentalMemCheck
和ctest -T memcheck
,但在這裏我最終出現了錯誤Cannot find file DartConfiguration.tcl
,這似乎與我不需要的儀表板配置有關。