diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2018-10-11 17:48:53 (GMT) |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2018-10-15 17:03:34 (GMT) |
commit | 60ca88d7261da8ad77e68d8f82ae67099af70df0 (patch) | |
tree | 1f489113cc39f07d3c0fc2d4d856fc021e829553 | |
parent | e2dd6ac9776e4f5a1995dfc606480b627fdbce72 (diff) | |
download | CMake-60ca88d7261da8ad77e68d8f82ae67099af70df0.zip CMake-60ca88d7261da8ad77e68d8f82ae67099af70df0.tar.gz CMake-60ca88d7261da8ad77e68d8f82ae67099af70df0.tar.bz2 |
ctest_submit: Generate Done.xml at submit time
This fixes a bug where calling `ctest_submit()` would result in a Done.xml
file with an empty <buildId> element.
CDash responds with a buildId when CTest submits a file. For this reason,
Done.xml needs to generated after CTest has submitted some other file to
CDash. This change also has the benefit of making Done.xml's timestamp as
late as possible, giving us a more accurate record of how long the entire
build took to complete.
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 6ad0e03..98872a5 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -467,6 +467,17 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP( cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5); } + // Generate Done.xml right before it is submitted. + // The reason for this is two-fold: + // 1) It must be generated after some other part has been submitted + // so we have a buildId to refer to in its contents. + // 2) By generating Done.xml here its timestamp will be as late as + // possible. This gives us a more accurate record of how long the + // entire build took to complete. + if (file == "Done.xml") { + this->CTest->GenerateDoneFile(); + } + if (!cmSystemTools::FileExists(local_file)) { cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " << local_file << std::endl); @@ -1420,7 +1431,6 @@ int cmCTestSubmitHandler::ProcessHandler() // Submit Done.xml last if (this->SubmitPart[cmCTest::PartDone]) { - this->CTest->GenerateDoneFile(); files.push_back("Done.xml"); } |