Decent testbed for further iteration
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
2
main.cpp
2
main.cpp
@@ -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()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user