Decent testbed for further iteration

This commit is contained in:
2024-06-17 15:16:37 -04:00
parent bec4bd93f8
commit f97b80dae1
2 changed files with 4 additions and 5 deletions

View File

@@ -20,10 +20,11 @@ namespace jtest {
{ {
try { try {
callback(); callback();
} catch(...) { } catch(const std::exception& e) {
jlog::log({ jlog::log({
{.content = std::format("{}:{}", file, line)},
{.colorCode = jlog::ansi_escape_codes::FG_RED, .content = testname}, {.colorCode = jlog::ansi_escape_codes::FG_RED, .content = testname},
{.content = "Failed!"} {.content = "Failed:", .delimiter = ""}
}); });
return false; return false;
} }
@@ -31,7 +32,7 @@ namespace jtest {
jlog::log({ jlog::log({
{.content = std::format("{}:{}", file, line)}, {.content = std::format("{}:{}", file, line)},
{.colorCode = jlog::ansi_escape_codes::FG_GREEN, .content = testname}, {.colorCode = jlog::ansi_escape_codes::FG_GREEN, .content = testname},
{.content = "Passed!", .delimiter = ""} {.content = "Passed:", .delimiter = ""}
}); });
return true; return true;
} }

View File

@@ -9,8 +9,6 @@
// Look into a different mechanism more similar to gtest wherein we have a TEST macro // Look into a different mechanism more similar to gtest wherein we have a TEST macro
// that declares and "registers" a test, and then inside our main block we call RUN_ALL_TESTS(argc, argv); // that declares and "registers" a test, and then inside our main block we call RUN_ALL_TESTS(argc, argv);
// Running into a suituation in which we can't catch assertations or "checks"
// Additionally, The tests appear to run out-of-order, but lambda functions shouldn't be asynchronous on their own?!!
int main() int main()
{ {