summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSubmitHandler.cxx
diff options
context:
space:
mode:
authorWouter Klouwen <wouter.klouwen@youview.com>2017-11-15 18:00:09 (GMT)
committerWouter Klouwen <wouter.klouwen@youview.com>2017-11-17 15:22:55 (GMT)
commit5fd979a8a3bc13aaf20c2833fe513df192d82fb1 (patch)
tree4a99189a6f387c43f92707645dcb0cfacb3d17ad /Source/CTest/cmCTestSubmitHandler.cxx
parente31288582977c10972af9baa3b0e41d758094d21 (diff)
downloadCMake-5fd979a8a3bc13aaf20c2833fe513df192d82fb1.zip
CMake-5fd979a8a3bc13aaf20c2833fe513df192d82fb1.tar.gz
CMake-5fd979a8a3bc13aaf20c2833fe513df192d82fb1.tar.bz2
CTest: adopt std::chrono::system_clock
After the refactor to make CTest use std::chrono::steady_clock for the keeping of time for test duration, there are still references to cmSystemTools::GetTime() left. To further adopt std::chrono for time related activities, this commit changes those remaining references to std::chrono::system_clock::now() calls and alters the storage from either unsigned int or double to std::chrono::system_clock::time_point. For ease of conversion, a converter method is added to cmXMLWriter that converts from a std::chrono::system_clock::time_point to the number of seconds since the UN*X epoch as that is expected behaviour. This means no more casts as required. Functionally should be no difference as the system_clock is implemented in the same terms.
Diffstat (limited to 'Source/CTest/cmCTestSubmitHandler.cxx')
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 6534fd1..86fee7a 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -1069,6 +1069,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
if (subproject) {
str << "subproject=" << curl.Escape(subproject) << "&";
}
+ auto timeNow =
+ std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
str << "stamp=" << curl.Escape(this->CTest->GetCurrentTag()) << "-"
<< curl.Escape(this->CTest->GetTestModelString()) << "&"
<< "model=" << curl.Escape(this->CTest->GetTestModelString()) << "&"
@@ -1077,8 +1079,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
<< "site=" << curl.Escape(this->CTest->GetCTestConfiguration("Site"))
<< "&"
<< "track=" << curl.Escape(this->CTest->GetTestModelString()) << "&"
- << "starttime=" << static_cast<int>(cmSystemTools::GetTime()) << "&"
- << "endtime=" << static_cast<int>(cmSystemTools::GetTime()) << "&"
+ << "starttime=" << timeNow << "&"
+ << "endtime=" << timeNow << "&"
<< "datafilesmd5[0]=" << md5sum << "&"
<< "type=" << curl.Escape(typeString);
std::string fields = str.str();