2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2008-10-12 18:41:06 +02:00
|
|
|
#include "cmCTestMemCheckCommand.h"
|
|
|
|
|
2020-08-30 11:54:41 +02:00
|
|
|
#include <cmext/string_view>
|
2017-04-14 19:02:05 +02:00
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
#include "cmCTest.h"
|
2017-04-14 19:02:05 +02:00
|
|
|
#include "cmCTestMemCheckHandler.h"
|
|
|
|
#include "cmMakefile.h"
|
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
void cmCTestMemCheckCommand::BindArguments()
|
2017-04-14 19:02:05 +02:00
|
|
|
{
|
2020-02-01 23:06:01 +01:00
|
|
|
this->cmCTestTestCommand::BindArguments();
|
|
|
|
this->Bind("DEFECT_COUNT"_s, this->DefectCount);
|
2017-04-14 19:02:05 +02:00
|
|
|
}
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2021-09-14 00:13:48 +02:00
|
|
|
cmCTestTestHandler* cmCTestMemCheckCommand::InitializeActualHandler()
|
2008-10-12 18:41:06 +02:00
|
|
|
{
|
2019-11-11 23:01:05 +01:00
|
|
|
cmCTestMemCheckHandler* handler = this->CTest->GetMemCheckHandler();
|
|
|
|
handler->Initialize();
|
2016-07-09 11:21:54 +02:00
|
|
|
|
|
|
|
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
|
|
|
this->Makefile, "MemoryCheckType", "CTEST_MEMORYCHECK_TYPE", this->Quiet);
|
|
|
|
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
|
|
|
this->Makefile, "MemoryCheckSanitizerOptions",
|
|
|
|
"CTEST_MEMORYCHECK_SANITIZER_OPTIONS", this->Quiet);
|
|
|
|
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
|
|
|
this->Makefile, "MemoryCheckCommand", "CTEST_MEMORYCHECK_COMMAND",
|
2015-08-17 11:37:30 +02:00
|
|
|
this->Quiet);
|
2016-07-09 11:21:54 +02:00
|
|
|
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
|
|
|
this->Makefile, "MemoryCheckCommandOptions",
|
|
|
|
"CTEST_MEMORYCHECK_COMMAND_OPTIONS", this->Quiet);
|
|
|
|
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
|
|
|
this->Makefile, "MemoryCheckSuppressionFile",
|
|
|
|
"CTEST_MEMORYCHECK_SUPPRESSIONS_FILE", this->Quiet);
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2015-08-17 11:37:30 +02:00
|
|
|
handler->SetQuiet(this->Quiet);
|
2008-10-12 18:41:06 +02:00
|
|
|
return handler;
|
|
|
|
}
|
2017-04-14 19:02:05 +02:00
|
|
|
|
|
|
|
void cmCTestMemCheckCommand::ProcessAdditionalValues(
|
|
|
|
cmCTestGenericHandler* handler)
|
|
|
|
{
|
2020-02-01 23:06:01 +01:00
|
|
|
if (!this->DefectCount.empty()) {
|
|
|
|
this->Makefile->AddDefinition(
|
|
|
|
this->DefectCount,
|
|
|
|
std::to_string(
|
|
|
|
static_cast<cmCTestMemCheckHandler*>(handler)->GetDefectCount()));
|
2017-04-14 19:02:05 +02:00
|
|
|
}
|
|
|
|
}
|