ctest: Fix STOP_TIME for vendored archive_parse_date from libarchive 3.8.8+

libarchive commit `422aae80ae` (Date parsing: reject date components
with numbers of more than 4 digits, 2026-05-07), backported to version
3.8.8 by libarchive commit `8cf7393f98` (Merge pull request `#3010`...,
2026-05-07, `v3.8.8~142`), disallows our non-standard hyphen-free date
format.  Convert to a standard format.
This commit is contained in:
Brad King
2026-08-11 12:10:59 -04:00
parent 6c7ec05762
commit 16984b0124
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -2864,7 +2864,7 @@ void cmCTest::SetStopTime(std::string const& time_str)
tzone_offset *= 100;
char buf[1024];
snprintf(buf, sizeof(buf), "%d%02d%02d %s %+05i", lctime->tm_year + 1900,
snprintf(buf, sizeof(buf), "%d-%02d-%02d %s %+05i", lctime->tm_year + 1900,
lctime->tm_mon + 1, lctime->tm_mday, time_str.c_str(),
tzone_offset);
+2 -2
View File
@@ -12,11 +12,11 @@ bool parse_date()
std::time_t now;
std::time(&now);
{
std::time_t t = cm_parse_date(now, "20000101 00:01:02 -0000");
std::time_t t = cm_parse_date(now, "2000-01-01 00:01:02 -0000");
ASSERT_EQUAL(t, 946684862);
}
{
std::time_t t = cm_parse_date(now, "20380601 00:01:02 -0000");
std::time_t t = cm_parse_date(now, "2038-06-01 00:01:02 -0000");
ASSERT_EQUAL(t, sizeof(time_t) <= 4 ? -1 : 2158963262);
}
return true;