summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorKevin Puetz <PuetzKevinA@JohnDeere.com>2020-04-03 20:07:01 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-26 15:27:05 (GMT)
commit6a6f1d1edd73902053d215ce3dc12267f05501e2 (patch)
tree9485d231fb1020279f1bc5bba862c33881bdf9be /Source/CTest
parent6cbaa8eb931950b8a834acc0c6f78a7290c4d3d9 (diff)
downloadCMake-6a6f1d1edd73902053d215ce3dc12267f05501e2.zip
CMake-6a6f1d1edd73902053d215ce3dc12267f05501e2.tar.gz
CMake-6a6f1d1edd73902053d215ce3dc12267f05501e2.tar.bz2
CTest: exit nonzero after message(SEND_ERROR|FATAL_ERROR)
Fixes: #21004
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx24
-rw-r--r--Source/CTest/cmCTestTestHandler.h4
2 files changed, 18 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 70e84ee..abd1207 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -819,14 +819,16 @@ void cmCTestTestHandler::CheckLabelFilter(cmCTestTestProperties& it)
this->CheckLabelFilterExclude(it);
}
-void cmCTestTestHandler::ComputeTestList()
+bool cmCTestTestHandler::ComputeTestList()
{
this->TestList.clear(); // clear list of test
- this->GetListOfTests();
+ if (!this->GetListOfTests()) {
+ return false;
+ }
if (this->RerunFailed) {
this->ComputeTestListForRerunFailed();
- return;
+ return true;
}
cmCTestTestHandler::ListOfTests::size_type tmsize = this->TestList.size();
@@ -882,6 +884,7 @@ void cmCTestTestHandler::ComputeTestList()
this->TestList = finalList;
this->UpdateMaxTestNameWidth();
+ return true;
}
void cmCTestTestHandler::ComputeTestListForRerunFailed()
@@ -1260,7 +1263,10 @@ bool cmCTestTestHandler::GetValue(const char* tag, std::string& value,
bool cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
std::vector<std::string>& failed)
{
- this->ComputeTestList();
+ if (!this->ComputeTestList()) {
+ return false;
+ }
+
this->StartTest = this->CTest->CurrentTime();
this->StartTestTime = std::chrono::system_clock::now();
auto elapsed_time_start = std::chrono::steady_clock::now();
@@ -1695,7 +1701,7 @@ bool cmCTestTestHandler::ParseResourceGroupsProperty(
return lexer.ParseString(val);
}
-void cmCTestTestHandler::GetListOfTests()
+bool cmCTestTestHandler::GetListOfTests()
{
if (!this->IncludeLabelRegExp.empty()) {
this->IncludeLabelRegularExpression.compile(
@@ -1748,14 +1754,15 @@ void cmCTestTestHandler::GetListOfTests()
// does the DartTestfile.txt exist ?
testFilename = "DartTestfile.txt";
} else {
- return;
+ return true;
}
if (!mf.ReadListFile(testFilename)) {
- return;
+ return false;
}
if (cmSystemTools::GetErrorOccuredFlag()) {
- return;
+ // SEND_ERROR or FATAL_ERROR in CTestTestfile or TEST_INCLUDE_FILES
+ return false;
}
const char* specFile = mf.GetDefinition("CTEST_RESOURCE_SPEC_FILE");
if (this->ResourceSpecFile.empty() && specFile) {
@@ -1764,6 +1771,7 @@ void cmCTestTestHandler::GetListOfTests()
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Done constructing a list of tests" << std::endl,
this->Quiet);
+ return true;
}
void cmCTestTestHandler::UseIncludeRegExp()
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index b26f8a6..f9e9391 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -286,10 +286,10 @@ private:
/**
* Get the list of tests in directory and subdirectories.
*/
- void GetListOfTests();
+ bool GetListOfTests();
// compute the lists of tests that will actually run
// based on union regex and -I stuff
- void ComputeTestList();
+ bool ComputeTestList();
// compute the lists of tests that will actually run
// based on LastTestFailed.log