Compare commits
2 commits
61c898f47f
...
c4b9bd8359
Author | SHA1 | Date | |
---|---|---|---|
c4b9bd8359 | |||
f457e5ae19 |
2 changed files with 17 additions and 5 deletions
|
@ -46,10 +46,10 @@ public:
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "_________________________[TEST RESULTS]_________________________";
|
std::cout << "_________________________[TEST RESULTS]_________________________\n";
|
||||||
std::cout << "Ran " << instance().m_failed_count + instance().m_pasesed_count << " tests:\n"
|
std::cout << "Ran " << instance().m_failed_count + instance().m_pasesed_count << " tests:\n"
|
||||||
<< "Passed: " << instance().m_pasesed_count << '\n'
|
<< "\tpassed: " << instance().m_pasesed_count << '\n'
|
||||||
<< "Failed: " << instance().m_failed_count << '\n';
|
<< "\tfailed: " << instance().m_failed_count << '\n';
|
||||||
|
|
||||||
return instance().m_failed_count;
|
return instance().m_failed_count;
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,7 @@ struct Case
|
||||||
return; // TODO(Light): Should we run the remaining tests after a failure?
|
return; // TODO(Light): Should we run the remaining tests after a failure?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
details::Registry::increment_passed_count();
|
||||||
std::cout << " --> SUCCESS :D" << "\n";
|
std::cout << " --> SUCCESS :D" << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
lt::test::Suite meta = []() {
|
lt::test::Suite meta = []() {
|
||||||
using lt::test::expect_eq;
|
using lt::test::expect_eq;
|
||||||
|
using lt::test::expect_true;
|
||||||
|
|
||||||
lt::test::Case { "test_1" } = [] {
|
lt::test::Case { "test_1" } = [] {
|
||||||
expect_eq(5, 5);
|
expect_eq(5, 5);
|
||||||
|
@ -12,7 +13,18 @@ lt::test::Suite meta = []() {
|
||||||
};
|
};
|
||||||
|
|
||||||
lt::test::Case { "test_3" } = [] {
|
lt::test::Case { "test_3" } = [] {
|
||||||
expect_eq(true, false);
|
auto exception_thrown = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
expect_eq(true, false);
|
||||||
|
}
|
||||||
|
catch (const std::exception &exp)
|
||||||
|
{
|
||||||
|
exception_thrown = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect_true(exception_thrown);
|
||||||
};
|
};
|
||||||
|
|
||||||
lt::test::Case { "test_4" } = [] {
|
lt::test::Case { "test_4" } = [] {
|
||||||
|
@ -20,6 +32,5 @@ lt::test::Suite meta = []() {
|
||||||
};
|
};
|
||||||
|
|
||||||
lt::test::Case { "test_5" } = [] {
|
lt::test::Case { "test_5" } = [] {
|
||||||
throw std::runtime_error("Uncaught std exception!");
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue