blob: 9351b0ba2b9e8b17bc885bf2ee0456b6f778848d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestCoverageCommand.h"
#include <set>
#include <cm/string_view>
#include <cmext/algorithm>
#include <cmext/string_view>
#include "cmCTest.h"
#include "cmCTestCoverageHandler.h"
class cmCTestGenericHandler;
void cmCTestCoverageCommand::BindArguments()
{
this->cmCTestHandlerCommand::BindArguments();
this->Bind("LABELS"_s, this->Labels);
}
void cmCTestCoverageCommand::CheckArguments(
std::vector<cm::string_view> const& keywords)
{
this->LabelsMentioned =
!this->Labels.empty() || cm::contains(keywords, "LABELS"_s);
}
cmCTestGenericHandler* cmCTestCoverageCommand::InitializeHandler()
{
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "CoverageCommand", "CTEST_COVERAGE_COMMAND", this->Quiet);
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "CoverageExtraFlags", "CTEST_COVERAGE_EXTRA_FLAGS",
this->Quiet);
cmCTestCoverageHandler* handler = this->CTest->GetCoverageHandler();
handler->Initialize();
// If a LABELS option was given, select only files with the labels.
if (this->LabelsMentioned) {
handler->SetLabelFilter(
std::set<std::string>(this->Labels.begin(), this->Labels.end()));
}
handler->SetQuiet(this->Quiet);
return handler;
}
|