diff options
author | Brad King <brad.king@kitware.com> | 2023-11-08 18:57:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-09 14:11:55 (GMT) |
commit | 07edab8ef222e8cd8e8322e0fdfadc72ca6d1740 (patch) | |
tree | 60fef60e5802321769a1614f35c898363b57037c /Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx | |
parent | d6b796854bcb0460b7d3a8eee3e79a9482b6fc62 (diff) | |
download | CMake-07edab8ef222e8cd8e8322e0fdfadc72ca6d1740.zip CMake-07edab8ef222e8cd8e8322e0fdfadc72ca6d1740.tar.gz CMake-07edab8ef222e8cd8e8322e0fdfadc72ca6d1740.tar.bz2 |
ctest_empty_binary_directory: Report more detail in failure message
Diffstat (limited to 'Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx index af495bb..2c92d77 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx @@ -2,25 +2,27 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestEmptyBinaryDirectoryCommand.h" -#include <sstream> - #include "cmCTestScriptHandler.h" - -class cmExecutionStatus; +#include "cmExecutionStatus.h" +#include "cmMakefile.h" +#include "cmMessageType.h" +#include "cmStringAlgorithms.h" bool cmCTestEmptyBinaryDirectoryCommand::InitialPass( - std::vector<std::string> const& args, cmExecutionStatus& /*unused*/) + std::vector<std::string> const& args, cmExecutionStatus& status) { if (args.size() != 1) { this->SetError("called with incorrect number of arguments"); return false; } - if (!cmCTestScriptHandler::EmptyBinaryDirectory(args[0])) { - std::ostringstream ostr; - ostr << "problem removing the binary directory: " << args[0]; - this->SetError(ostr.str()); - return false; + std::string err; + if (!cmCTestScriptHandler::EmptyBinaryDirectory(args[0], err)) { + status.GetMakefile().IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat("Did not remove the binary directory:\n ", args[0], + "\nbecause:\n ", err)); + return true; } return true; |