Fix ci & add run test cost

This commit is contained in:
halx99 2021-12-23 18:52:33 +08:00
parent 32cccfe377
commit 0d87d4f717
2 changed files with 6 additions and 3 deletions

View File

@ -8,6 +8,8 @@
#include <string>
#include <time.h>
#ifndef PUGIXML_NO_EXCEPTIONS
# include <exception>
#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;
}

View File

@ -563,7 +563,7 @@ TEST(parse_escapes_unicode)
CHECK(doc.load_string(STR("<node>&#x03B3;&#x03b3;&#x24B62;</node>"), 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);