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 "cmCTestCoverageCommand.h"
|
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
#include <set>
|
|
|
|
|
2020-08-30 11:54:41 +02:00
|
|
|
#include <cmext/string_view>
|
2020-02-01 23:06:01 +01:00
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
#include "cmCTest.h"
|
2009-10-04 10:30:41 +03:00
|
|
|
#include "cmCTestCoverageHandler.h"
|
|
|
|
|
2016-10-30 18:24:19 +01:00
|
|
|
class cmCTestGenericHandler;
|
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
void cmCTestCoverageCommand::BindArguments()
|
|
|
|
{
|
|
|
|
this->cmCTestHandlerCommand::BindArguments();
|
|
|
|
this->Bind("LABELS"_s, this->Labels);
|
|
|
|
}
|
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler()
|
|
|
|
{
|
2016-07-09 11:21:54 +02:00
|
|
|
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
|
|
|
this->Makefile, "CoverageCommand", "CTEST_COVERAGE_COMMAND", this->Quiet);
|
|
|
|
this->CTest->SetCTestConfigurationFromCMakeVariable(
|
|
|
|
this->Makefile, "CoverageExtraFlags", "CTEST_COVERAGE_EXTRA_FLAGS",
|
|
|
|
this->Quiet);
|
2019-11-11 23:01:05 +01:00
|
|
|
cmCTestCoverageHandler* handler = this->CTest->GetCoverageHandler();
|
|
|
|
handler->Initialize();
|
2009-10-04 10:30:41 +03:00
|
|
|
|
|
|
|
// If a LABELS option was given, select only files with the labels.
|
2022-11-16 20:14:03 +01:00
|
|
|
if (this->Labels) {
|
2020-02-01 23:06:01 +01:00
|
|
|
handler->SetLabelFilter(
|
2022-11-16 20:14:03 +01:00
|
|
|
std::set<std::string>(this->Labels->begin(), this->Labels->end()));
|
2016-07-09 11:21:54 +02:00
|
|
|
}
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2015-08-17 11:37:30 +02:00
|
|
|
handler->SetQuiet(this->Quiet);
|
2008-10-12 18:41:06 +02:00
|
|
|
return handler;
|
|
|
|
}
|