MCPcopy Create free account
hub / github.com/Kitware/CMake / InitializeHandler

Method InitializeHandler

Source/CTest/cmCTestTestCommand.cxx:23–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include "cmValue.h"
22
23std::unique_ptr<cmCTestGenericHandler> cmCTestTestCommand::InitializeHandler(
24 HandlerArguments& arguments, cmExecutionStatus& status) const
25{
26 cmMakefile& mf = status.GetMakefile();
27 auto& args = static_cast<TestArguments&>(arguments);
28 cmValue ctestTimeout = mf.GetDefinition("CTEST_TEST_TIMEOUT");
29
30 cmDuration timeout;
31 if (ctestTimeout) {
32 timeout = cmDuration(atof(ctestTimeout->c_str()));
33 } else {
34 timeout = this->CTest->GetTimeOut();
35 if (timeout <= cmDuration::zero()) {
36 // By default use timeout of 10 minutes
37 timeout = std::chrono::minutes(10);
38 }
39 }
40 this->CTest->SetTimeOut(timeout);
41
42 cmValue resourceSpecFile = mf.GetDefinition("CTEST_RESOURCE_SPEC_FILE");
43 if (args.ResourceSpecFile.empty() && resourceSpecFile) {
44 args.ResourceSpecFile = *resourceSpecFile;
45 }
46
47 auto handler = this->InitializeActualHandler(args, status);
48 if (!args.Start.empty() || !args.End.empty() || !args.Stride.empty()) {
49 handler->TestOptions.TestsToRunInformation =
50 cmStrCat(args.Start, ',', args.End, ',', args.Stride);
51 }
52 if (!args.Exclude.empty()) {
53 handler->TestOptions.ExcludeRegularExpression = args.Exclude;
54 }
55 if (!args.Include.empty()) {
56 handler->TestOptions.IncludeRegularExpression = args.Include;
57 }
58 if (!args.ExcludeLabel.empty()) {
59 handler->TestOptions.ExcludeLabelRegularExpression.push_back(
60 args.ExcludeLabel);
61 }
62 if (!args.IncludeLabel.empty()) {
63 handler->TestOptions.LabelRegularExpression.push_back(args.IncludeLabel);
64 }
65
66 if (!args.ExcludeTestsFromFile.empty()) {
67 handler->TestOptions.ExcludeTestListFile = args.ExcludeTestsFromFile;
68 }
69 if (!args.IncludeTestsFromFile.empty()) {
70 handler->TestOptions.TestListFile = args.IncludeTestsFromFile;
71 }
72
73 if (!args.ExcludeFixture.empty()) {
74 handler->TestOptions.ExcludeFixtureRegularExpression = args.ExcludeFixture;
75 }
76 if (!args.ExcludeFixtureSetup.empty()) {
77 handler->TestOptions.ExcludeFixtureSetupRegularExpression =
78 args.ExcludeFixtureSetup;
79 }
80 if (!args.ExcludeFixtureCleanup.empty()) {

Callers

nothing calls this directly

Calls 15

cmStrToULongFunction · 0.85
cmNonemptyFunction · 0.85
moveFunction · 0.85
c_strMethod · 0.80
GetTimeOutMethod · 0.80
SetTimeOutMethod · 0.80
push_backMethod · 0.80
SetStopTimeMethod · 0.80
SetCTestConfigurationMethod · 0.80
SetJUnitXMLFileNameMethod · 0.80
cmStrCatFunction · 0.50

Tested by

no test coverage detected