diff options
author | Betsy McPhail <betsy.mcphail@kitware.com> | 2017-03-27 18:08:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-29 14:29:57 (GMT) |
commit | b070947dffd141d50227c59feed4c3d784b39157 (patch) | |
tree | b9c83e19b826a4d01e0aba3df85f28bbd0f443ef /Source/CTest/cmCTestRunTest.cxx | |
parent | 42c68aadf81a47d563392421636e14ef77644e03 (diff) | |
download | CMake-b070947dffd141d50227c59feed4c3d784b39157.zip CMake-b070947dffd141d50227c59feed4c3d784b39157.tar.gz CMake-b070947dffd141d50227c59feed4c3d784b39157.tar.bz2 |
Add 'DISABLED' test property
When this property is set, the test is skipped and its status is
automatically set to 'Not Run'. A disabled test will not be counted in
the total number of tests and its completion status will be 'Disabled'.
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index be2b59e..94aa4bd 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -256,6 +256,8 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) cmCTestLog(this->CTest, HANDLER_OUTPUT, "Other"); this->TestResult.Status = cmCTestTestHandler::OTHER_FAULT; } + } else if ("Disabled" == this->TestResult.CompletionStatus) { + cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Not Run (Disabled) "); } else // cmsysProcess_State_Error { cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Not Run "); @@ -416,6 +418,24 @@ bool cmCTestRunTest::StartTest(size_t total) << this->TestProperties->Index << ": " << this->TestProperties->Name << std::endl); this->ProcessOutput.clear(); + + // Return immediately if test is disabled + if (this->TestProperties->Disabled) { + this->TestResult.Properties = this->TestProperties; + this->TestResult.ExecutionTime = 0; + this->TestResult.CompressOutput = false; + this->TestResult.ReturnValue = -1; + this->TestResult.CompletionStatus = "Disabled"; + this->TestResult.Status = cmCTestTestHandler::NOT_RUN; + this->TestResult.TestCount = this->TestProperties->Index; + this->TestResult.Name = this->TestProperties->Name; + this->TestResult.Path = this->TestProperties->Directory; + this->TestProcess = new cmProcess; + this->TestResult.Output = "Disabled"; + this->TestResult.FullCommandLine = ""; + return false; + } + this->ComputeArguments(); std::vector<std::string>& args = this->TestProperties->Args; this->TestResult.Properties = this->TestProperties; |