diff options
author | Brad King <brad.king@kitware.com> | 2023-05-03 17:12:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-04 14:27:58 (GMT) |
commit | cd4038fe94caa6f9a18291081a6e8801b91a2368 (patch) | |
tree | 97803ac32fd40a772814f15d4f0ae3be4bb89508 | |
parent | 0d2d5a229c1cda842f0e67134637f19fc69de6c6 (diff) | |
download | CMake-cd4038fe94caa6f9a18291081a6e8801b91a2368.zip CMake-cd4038fe94caa6f9a18291081a6e8801b91a2368.tar.gz CMake-cd4038fe94caa6f9a18291081a6e8801b91a2368.tar.bz2 |
cmCTestTestHandler: Use in-class initialization of properties and results
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 5 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 11 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 34 |
3 files changed, 17 insertions, 33 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 5efe69f..23f437a 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -30,11 +30,6 @@ cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler) { this->CTest = multiHandler.CTest; this->TestHandler = multiHandler.TestHandler; - this->TestResult.ExecutionTime = cmDuration::zero(); - this->TestResult.ReturnValue = 0; - this->TestResult.Status = cmCTestTestHandler::NOT_RUN; - this->TestResult.TestCount = 0; - this->TestResult.Properties = nullptr; } void cmCTestRunTest::CheckOutput(std::string const& line) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 3a1cb64..bfc6bd6 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2431,17 +2431,6 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args) "Set test directory: " << test.Directory << std::endl, this->Quiet); - test.IsInBasedOnREOptions = true; - test.WillFail = false; - test.Disabled = false; - test.RunSerial = false; - test.Timeout = cmDuration::zero(); - test.ExplicitTimeout = false; - test.Cost = 0; - test.Processors = 1; - test.WantAffinity = false; - test.SkipReturnCode = -1; - test.PreviousRuns = 0; if (this->UseIncludeRegExpFlag && (!this->IncludeTestsRegularExpression.find(testname) || (!this->UseExcludeRegExpFirst && diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index d0049da..29d24e0 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -139,22 +139,22 @@ public: std::vector<std::pair<cmsys::RegularExpression, std::string>> TimeoutRegularExpressions; std::map<std::string, std::string> Measurements; - bool IsInBasedOnREOptions; - bool WillFail; - bool Disabled; - float Cost; - int PreviousRuns; - bool RunSerial; - cmDuration Timeout; - bool ExplicitTimeout; + bool IsInBasedOnREOptions = true; + bool WillFail = false; + bool Disabled = false; + float Cost = 0; + int PreviousRuns = 0; + bool RunSerial = false; + cmDuration Timeout = cmDuration::zero(); + bool ExplicitTimeout = false; cmDuration AlternateTimeout; - int Index; + int Index = 0; // Requested number of process slots - int Processors; - bool WantAffinity; + int Processors = 1; + bool WantAffinity = false; std::vector<size_t> Affinity; // return code of test which will mark test as "not run" - int SkipReturnCode; + int SkipReturnCode = -1; std::vector<std::string> Environment; std::vector<std::string> EnvironmentModification; std::vector<std::string> Labels; @@ -175,17 +175,17 @@ public: std::string Reason; std::string FullCommandLine; std::string Environment; - cmDuration ExecutionTime; - std::int64_t ReturnValue; - int Status; + cmDuration ExecutionTime = cmDuration::zero(); + std::int64_t ReturnValue = 0; + int Status = NOT_RUN; std::string ExceptionStatus; bool CompressOutput; std::string CompletionStatus; std::string CustomCompletionStatus; std::string Output; std::string TestMeasurementsOutput; - int TestCount; - cmCTestTestProperties* Properties; + int TestCount = 0; + cmCTestTestProperties* Properties = nullptr; }; struct cmCTestTestResultLess |