summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-12-26 21:02:52 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-12-27 15:53:52 (GMT)
commitb393b32b4bb0bc830edc89df6262ad710cd0a3e2 (patch)
tree1821b45e3d1e2655e833e755819548addabfa68e /Source/CTest/cmCTestTestHandler.cxx
parent51cc3f1bff2c3637365a9046c2808cd2cf02927b (diff)
downloadCMake-b393b32b4bb0bc830edc89df6262ad710cd0a3e2.zip
CMake-b393b32b4bb0bc830edc89df6262ad710cd0a3e2.tar.gz
CMake-b393b32b4bb0bc830edc89df6262ad710cd0a3e2.tar.bz2
CTest: Improve error handling when reading resource spec file
Fixes: #20079
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 8e3ac22..c8bbb0b 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -513,9 +513,13 @@ bool cmCTestTestHandler::ProcessOptions()
val = this->GetOption("ResourceSpecFile");
if (val) {
this->UseResourceSpec = true;
- if (!this->ResourceSpec.ReadFromJSONFile(val)) {
+ auto result = this->ResourceSpec.ReadFromJSONFile(val);
+ if (result != cmCTestResourceSpec::ReadFileResult::READ_OK) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Could not read resource spec file: " << val << std::endl);
+ "Could not read/parse resource spec file "
+ << val << ": "
+ << cmCTestResourceSpec::ResultToString(result)
+ << std::endl);
return false;
}
}