diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2017-07-11 15:22:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-07-12 17:29:21 (GMT) |
commit | 0c650f39659a62c03012ec07dc32effd3bfba6e8 (patch) | |
tree | 33a1deb8d5e1e60746b5b0fe1987fe04f4f852ca /Source/CTest/cmCTestTestHandler.cxx | |
parent | 1fda77d45565c3a819e6149597c3a194d9ccd0bb (diff) | |
download | CMake-0c650f39659a62c03012ec07dc32effd3bfba6e8.zip CMake-0c650f39659a62c03012ec07dc32effd3bfba6e8.tar.gz CMake-0c650f39659a62c03012ec07dc32effd3bfba6e8.tar.bz2 |
CTest: Report more detail about system exceptions in tests
This passes the system exception string up to CDash and to the command line
instead of just printing "other".
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 674be60..4229da1 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1,12 +1,10 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestTestHandler.h" - -#include "cmsys/Base64.h" -#include "cmsys/Directory.hxx" -#include "cmsys/FStream.hxx" -#include "cmsys/RegularExpression.hxx" #include <algorithm> +#include <cmsys/Base64.h> +#include <cmsys/Directory.hxx> +#include <cmsys/RegularExpression.hxx> #include <functional> #include <iomanip> #include <iterator> @@ -33,6 +31,7 @@ #include "cm_auto_ptr.hxx" #include "cm_utf8.h" #include "cmake.h" +#include "cmsys/FStream.hxx" class cmExecutionStatus; @@ -549,10 +548,10 @@ int cmCTestTestHandler::ProcessHandler() !cmHasLiteralPrefix(ftit->CompletionStatus, "SKIP_RETURN_CODE=") && ftit->CompletionStatus != "Disabled") { ofs << ftit->TestCount << ":" << ftit->Name << std::endl; - cmCTestLog( - this->CTest, HANDLER_OUTPUT, "\t" - << std::setw(3) << ftit->TestCount << " - " << ftit->Name << " (" - << this->GetTestStatus(ftit->Status) << ")" << std::endl); + cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" + << std::setw(3) << ftit->TestCount << " - " + << ftit->Name << " (" << this->GetTestStatus(&*ftit) + << ")" << std::endl); } } } @@ -1299,7 +1298,7 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml) xml.StartElement("NamedMeasurement"); xml.Attribute("type", "text/string"); xml.Attribute("name", "Exit Code"); - xml.Element("Value", this->GetTestStatus(result->Status)); + xml.Element("Value", this->GetTestStatus(result)); xml.EndElement(); // NamedMeasurement xml.StartElement("NamedMeasurement"); @@ -1693,17 +1692,20 @@ void cmCTestTestHandler::UseExcludeRegExp() this->UseExcludeRegExpFirst = !this->UseIncludeRegExpFlag; } -const char* cmCTestTestHandler::GetTestStatus(int status) +const char* cmCTestTestHandler::GetTestStatus(const cmCTestTestResult* result) { static const char* statuses[] = { "Not Run", "Timeout", "SEGFAULT", "ILLEGAL", "INTERRUPT", "NUMERICAL", "OTHER_FAULT", "Failed", "BAD_COMMAND", "Completed" }; - + int status = result->Status; if (status < cmCTestTestHandler::NOT_RUN || status > cmCTestTestHandler::COMPLETED) { return "No Status"; } + if (status == cmCTestTestHandler::OTHER_FAULT) { + return result->ExceptionStatus.c_str(); + } return statuses[status]; } |