Skip to content

Commit

Permalink
Update test results output
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Oct 17, 2024
1 parent 517ec2c commit ba71f15
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,22 @@ namespace assert_unit_tests {
return xtd::startup::safe_run(xtd::delegate<int()>([] {
xtd::exception::enable_stack_trace(false);
xtd::tunit::test::__internal_tunit_unit_tests_mode__ = reinterpret_cast<xtd::intptr>("internal_tests");
std::cout << "Start unit tests" << std::endl;
std::cout << "Run tests:" << std::endl;
try {
for (auto assert_unit_test : assert_unit_tests::register_assert_unit_test::assert_unit_tests)
assert_unit_test.method(assert_unit_test.name);
} catch (...) {
std::cout << "end unit tests" << std::endl;
std::cout << std::endl << xtd::foreground_color(xtd::console_color::dark_red) << "FAILED TEST" << xtd::reset_color() << std::endl;
std::cout << std::endl << "Test results:" << std::endl;
std::cout << xtd::foreground_color(xtd::console_color::dark_red) << "FAILED TEST" << xtd::reset_color() << std::endl;
std::cout << "End" << std::endl;
std::cout << std::endl;
return 1;
}

std::cout << "end unit tests" << std::endl;
std::cout << std::endl << xtd::foreground_color(xtd::console_color::dark_green) << "SUCCEED " << xtd::reset_color() << assert_unit_tests::register_assert_unit_test::assert_unit_tests.size() << " tests." << std::endl;
if (ignore_test_count) std::cout << std::endl << "You have " << ignore_test_count << " ignored test" << (ignore_test_count < 2 ? "" : "s") << std::endl;
std::cout << std::endl << "Test results:" << std::endl;
std::cout << xtd::foreground_color(xtd::console_color::dark_green) << " SUCCEED " << xtd::reset_color() << assert_unit_tests::register_assert_unit_test::assert_unit_tests.size() << " tests." << std::endl;
if (ignore_test_count) std::cout << std::endl << " You have " << ignore_test_count << " ignored test" << (ignore_test_count < 2 ? "" : "s") << std::endl;
std::cout << "End" << std::endl;
std::cout << std::endl;
return 0;
}));
Expand Down

0 comments on commit ba71f15

Please sign in to comment.