refactor(test): replace all std::couts with std::println
Some checks are pending
continuous-integration/drone/push Build is running
Some checks are pending
continuous-integration/drone/push Build is running
This commit is contained in:
parent
d029c0e473
commit
4534ed11d2
2 changed files with 25 additions and 23 deletions
|
|
@ -9,9 +9,9 @@ try
|
||||||
}
|
}
|
||||||
catch (const std::exception &exp)
|
catch (const std::exception &exp)
|
||||||
{
|
{
|
||||||
std::cout << "Fuzz input resulted in uncaught exception:\n";
|
std::println("Fuzz input resulted in uncaught exception:");
|
||||||
std::cout << "\texception.what: " << exp.what() << '\n';
|
std::println("\twhat: {}", exp.what());
|
||||||
std::cout << "\tinput size: " << size << '\n';
|
std::println("\tinput size: {}", size);
|
||||||
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,21 +178,23 @@ private:
|
||||||
{
|
{
|
||||||
case ExecutionPolicy::normal:
|
case ExecutionPolicy::normal:
|
||||||
{
|
{
|
||||||
std::cout << "[-------STATS------]\n"
|
std::println("[-------STATS------]");
|
||||||
<< "suites:\n"
|
|
||||||
<< "\ttotal: " << m_total_suite_count << '\n'
|
|
||||||
<< "\tpassed: " << m_passed_suite_count << '\n'
|
|
||||||
<< "\tfailed: " << m_failed_suite_count << '\n'
|
|
||||||
<< "\tmatched: " << m_matched_suite_count << '\n'
|
|
||||||
<< "\tskipped: " << m_skipped_suite_count << '\n'
|
|
||||||
<< "tests:\n"
|
|
||||||
<< "\ttotal: " << m_total_case_count << '\n'
|
|
||||||
<< "\tpassed: " << m_passed_case_count << '\n'
|
|
||||||
<< "\tfailed: " << m_failed_case_count << '\n'
|
|
||||||
<< "\tmatched: " << m_matched_case_count << '\n'
|
|
||||||
<< "\tskipped: " << m_skipped_case_count << '\n';
|
|
||||||
|
|
||||||
std::cout << "________________________________________________________________\n\n\n";
|
std::println("suites:");
|
||||||
|
std::println("\ttotal: {}", m_total_suite_count);
|
||||||
|
std::println("\tpassed: {}", m_passed_suite_count);
|
||||||
|
std::println("\tfailed: {}", m_failed_suite_count);
|
||||||
|
std::println("\tmatched: {}", m_matched_suite_count);
|
||||||
|
std::println("\tskipped: {}", m_skipped_suite_count);
|
||||||
|
|
||||||
|
std::println("tests:");
|
||||||
|
std::println("\ttotal: {}", m_total_case_count);
|
||||||
|
std::println("\tpassed: {}", m_passed_case_count);
|
||||||
|
std::println("\tfailed: {}", m_failed_case_count);
|
||||||
|
std::println("\tmatched: {}", m_matched_case_count);
|
||||||
|
std::println("\tskipped: {}", m_skipped_case_count);
|
||||||
|
|
||||||
|
std::println("________________________________________________________________");
|
||||||
|
|
||||||
return m_failed_case_count;
|
return m_failed_case_count;
|
||||||
}
|
}
|
||||||
|
|
@ -214,7 +216,7 @@ private:
|
||||||
|
|
||||||
Registry()
|
Registry()
|
||||||
{
|
{
|
||||||
std::cout << "________________________________________________________________\n";
|
std::println("________________________________________________________________");
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] static auto instance() -> Registry &
|
[[nodiscard]] static auto instance() -> Registry &
|
||||||
|
|
@ -289,16 +291,16 @@ private:
|
||||||
}
|
}
|
||||||
Registry::increment_matched_case_count();
|
Registry::increment_matched_case_count();
|
||||||
|
|
||||||
std::cout << "[Running-----------] --> ";
|
std::println("[Running-----------] --> ");
|
||||||
std::cout << m_name << '\n';
|
std::println("{}", m_name);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
catch (const std::exception &exp)
|
catch (const std::exception &exp)
|
||||||
{
|
{
|
||||||
std::cout << exp.what() << "\n";
|
std::println("{}", exp.what());
|
||||||
std::cout << "[-----------FAIL !!]" << "\n\n";
|
std::println("[-----------FAIL !!]");
|
||||||
Registry::increment_failed_case_count();
|
Registry::increment_failed_case_count();
|
||||||
|
|
||||||
if (Registry::should_return_on_failure())
|
if (Registry::should_return_on_failure())
|
||||||
|
|
@ -310,7 +312,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
Registry::increment_passed_case_count();
|
Registry::increment_passed_case_count();
|
||||||
std::cout << "[--------SUCCESS :D]" << "\n\n";
|
std::println("[--------SUCCESS :D]");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view m_name;
|
std::string_view m_name;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue