From 0d87d4f717a77fd536d222a4827e2dbd2a120e74 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 23 Dec 2021 18:52:33 +0800 Subject: [PATCH] Fix ci & add run test cost --- tests/main.cpp | 7 +++++-- tests/test_parse.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/main.cpp b/tests/main.cpp index 352b58b..efdf7b0 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -8,6 +8,8 @@ #include +#include + #ifndef PUGIXML_NO_EXCEPTIONS # include #endif @@ -170,6 +172,7 @@ int main(int, char** argv) #ifdef __BORLANDC__ _control87(MCW_EM | PC_53, MCW_EM | MCW_PC); #endif + clock_t start = clock(); // setup temp path as the executable folder std::string temp = argv[0]; @@ -203,9 +206,9 @@ int main(int, char** argv) unsigned int failed = total - passed; if (failed != 0) - printf("FAILURE: %u out of %u tests failed.\n", failed, total); + printf("FAILURE: %u out of %u tests failed, cost %g(s).\n", failed, total, (clock() - start) / (double)CLOCKS_PER_SEC); else - printf("Success: %u tests passed.\n", total); + printf("Success: %u tests passed, cost %g(s).\n", total, (clock() - start) / (double)CLOCKS_PER_SEC); return failed; } diff --git a/tests/test_parse.cpp b/tests/test_parse.cpp index aa70d49..680dae9 100644 --- a/tests/test_parse.cpp +++ b/tests/test_parse.cpp @@ -563,7 +563,7 @@ TEST(parse_escapes_unicode) CHECK(doc.load_string(STR("γγ𤭢"), parse_minimal | parse_escapes)); #ifdef PUGIXML_WCHAR_MODE - const char_t* v = doc.child_value(STR("node")); + string_view_t v = doc.child_value(STR("node")); size_t wcharsize = sizeof(wchar_t);