@@ -90,8 +90,8 @@ struct TestCase {
9090 std::stringstream ss;
9191 ss << start << " >" << std::endl;
9292
93- ss << * std::ranges::fold_left_first (xml_results,
94- [](const std::string& acc, const std::string& r) { return acc + " \n " + r; });
93+ ss << std::accumulate (xml_results. begin (), xml_results. end (), std::string{} ,
94+ [](const std::string& acc, const std::string& r) { return acc + " \n " + r; });
9595 ss << std::endl;
9696 ss << " </testcase>" ;
9797 return ss.str ();
@@ -115,8 +115,18 @@ struct TestSuite {
115115 : id(get_next_id()), name(std::move(name)), time(time), timestamp(timestamp), tests(tests), failures(failures) {}
116116
117117 [[nodiscard]] std::string to_xml () const {
118- auto timestamp_str =
119- std::format (" {0:%F}T{0:%T}" , std::chrono::zoned_time (std::chrono::current_zone (), timestamp).get_local_time ());
118+ std::string timestamp_str;
119+ if constexpr (requires { std::chrono::current_zone (); }) {
120+ auto localtime = std::chrono::zoned_time (std::chrono::current_zone (), timestamp).get_local_time ();
121+ timestamp_str = std::format (" {0:%F}T{0:%T}" , localtime);
122+ } else {
123+ // Cludge because macOS doesn't have std::chrono::current_zone() or std::chrono::zoned_time()
124+ std::time_t time_t_timestamp = std::chrono::system_clock::to_time_t (timestamp);
125+ std::tm localtime = *std::localtime (&time_t_timestamp);
126+ std::ostringstream oss;
127+ oss << std::put_time (&localtime, " %Y-%m-%dT%H:%M:%S" );
128+ timestamp_str = oss.str ();
129+ }
120130
121131 std::stringstream ss;
122132 ss << " "
0 commit comments