summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
diff options
context:
space:
mode:
authorBetsy McPhail <betsy.mcphail@kitware.com>2017-03-27 18:08:50 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-29 14:29:57 (GMT)
commitb070947dffd141d50227c59feed4c3d784b39157 (patch)
treeb9c83e19b826a4d01e0aba3df85f28bbd0f443ef /Source/CTest/cmCTestRunTest.cxx
parent42c68aadf81a47d563392421636e14ef77644e03 (diff)
downloadCMake-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.cxx20
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;