35using namespace std::literals;
43 using namespace steppable::__internals::stringUtils; \
44 using namespace steppable::__internals::utils; \
45 using namespace steppable::testing; \
46 using namespace steppable::output; \
47 Utf8CodePage use_utf8; \
54 const std::string& nameSection = #__VA_ARGS__; \
55 std::cout << colors::brightBlue << std::setw(80) << std::setfill('-') << reset << '\n'; \
56 std::cout << colors::brightBlue << "[Testing: " << nameSection << ']' << reset << '\n'; \
57 auto start = std::chrono::high_resolution_clock::now(); \
58 auto _ = TestCase(nameSection);
62#define SECTION_END() \
63 auto end = std::chrono::high_resolution_clock::now(); \
65 std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - start) \
68 std::cout << colors::brightBlue << '[' << nameSection << " took " << duration << "(microseconds) to finish]" \
70 std::cout << reset << '\n'; \
71 errors += _.errorCount; \
78 error("TEST_END"s, "Not all tests passed. There are {0} errors."s, { std::to_string(errors) }); \
80 info("TEST_END"s, "All tests passed."s); \
81 std::cout << colors::brightBlue << std::setw(80) << std::setfill('=') << reset << '\n'; \
104 void assert(
bool condition,
const std::string& conditionName);
122 void assertIsEqual(
const std::string& a,
const std::string& b);
int errorCount
Definition testing.hpp:109
std::string testCaseName
Definition testing.hpp:106
TestCase(std::string testCaseName)
Constructs a new TestCase object with the given name.
Definition testing.cpp:36
void summarize() const
Prints a summary of the test case, including the number of errors encountered.
Definition testing.cpp:89
void assertFalse(bool value)
Asserts that a boolean value is false.
Definition testing.cpp:83
void assertTrue(bool value)
Asserts that a boolean value is true.
Definition testing.cpp:77
void assertIsEqual(const std::string &a, const std::string &b)
Asserts that two strings are equal.
Definition testing.cpp:51
void assertIsNotEqual(const std::string &a, const std::string &b)
Asserts that two strings are not equal.
Definition testing.cpp:57
void assert(bool condition, const std::string &conditionName)
Asserts a given condition and logs the condition name if it fails.
Definition testing.cpp:38
Includes testing utilities for Steppable.
Definition testing.cpp:35