|
FuncDoodle
|
Lightweight testing framework for FuncDoodle. More...
#include <atomic>#include <cstring>#include <iostream>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | FuncDoodle::TestResult |
| Represents a single failed or recorded test assertion. More... | |
| class | FuncDoodle::TestRegistry |
| Global singleton collecting test scope results. More... | |
| struct | FuncDoodle::TestRegistry::ScopeResult |
| class | FuncDoodle::TestScope |
| RAII-style test container for grouping assertions. More... | |
Namespaces | |
| namespace | FuncDoodle |
| The FuncDoodle C++ namespace. | |
Macros | |
| #define | CURRENT_FUNC __func__ |
| #define | TEST_SCOPE(name) |
| Starts a named RAII test scope. | |
| #define | CHECK(cond, msg) |
| Records whether a condition is true. | |
| #define | CHECK_EQ(a, b, msg) |
| Records whether two expressions are equal. | |
| #define | CHECK_NE(a, b, msg) |
| Records whether two expressions are not equal. | |
| #define | CHECK_LT(a, b, msg) |
| Records whether the left expression is less than the right. | |
| #define | CHECK_LE(a, b, msg) |
| Records whether the left expression is less than or equal to the right. | |
| #define | CHECK_GT(a, b, msg) |
| Records whether the left expression is greater than the right. | |
| #define | CHECK_GE(a, b, msg) |
| Records whether the left expression is greater than or equal to the right. | |
| #define | CHECK_NULL(ptr, msg) |
| Records whether a pointer is null. | |
| #define | CHECK_NOT_NULL(ptr, msg) |
| Records whether a pointer is non-null. | |
Functions | |
| std::string | FuncDoodle::Repeat (std::string_view s, size_t n) |
| Repeats a string N times. | |
Lightweight testing framework for FuncDoodle.
This file implements a minimal unit testing system used for both:
Features:
The framework is designed to be simple, header-only, and zero-dependency aside from the optional ImGui test engine.
| #define CHECK | ( | cond, | |
| msg ) |
Records whether a condition is true.
| #define CHECK_EQ | ( | a, | |
| b, | |||
| msg ) |
Records whether two expressions are equal.
| #define CHECK_GE | ( | a, | |
| b, | |||
| msg ) |
Records whether the left expression is greater than or equal to the right.
| #define CHECK_GT | ( | a, | |
| b, | |||
| msg ) |
Records whether the left expression is greater than the right.
| #define CHECK_LE | ( | a, | |
| b, | |||
| msg ) |
Records whether the left expression is less than or equal to the right.
| #define CHECK_LT | ( | a, | |
| b, | |||
| msg ) |
Records whether the left expression is less than the right.
| #define CHECK_NE | ( | a, | |
| b, | |||
| msg ) |
Records whether two expressions are not equal.
| #define CHECK_NOT_NULL | ( | ptr, | |
| msg ) |
Records whether a pointer is non-null.
| #define CHECK_NULL | ( | ptr, | |
| msg ) |
Records whether a pointer is null.
| #define CURRENT_FUNC __func__ |
| #define TEST_SCOPE | ( | name | ) |
Starts a named RAII test scope.