libept
|
#include <string>
#include <sstream>
#include <exception>
#include <functional>
#include <vector>
Go to the source code of this file.
Classes | |
struct | ept::tests::LocationInfo |
Add information to the test backtrace for the tests run in the current scope. More... | |
struct | ept::tests::TestStackFrame |
Information about one stack frame in the test execution stack. More... | |
struct | ept::tests::TestStack |
struct | ept::tests::TestFailed |
Exception raised when a test assertion fails, normally by Location::fail_test. More... | |
struct | ept::tests::Actual< A > |
struct | ept::tests::ActualCString |
struct | ept::tests::ActualStdString |
struct | ept::tests::ActualDouble |
struct | ept::tests::ActualFunction |
struct | ept::tests::TestMethodResult |
Result of running a test method. More... | |
struct | ept::tests::TestCaseResult |
Result of running a whole test case. More... | |
struct | ept::tests::TestController |
Abstract interface for the objects that supervise test execution. More... | |
struct | ept::tests::SimpleTestController |
Simple default implementation of TestController. More... | |
struct | ept::tests::TestRegistry |
Test registry. More... | |
struct | ept::tests::TestMethod |
Test method information. More... | |
struct | ept::tests::TestCase |
Test case collecting several test methods, and self-registering with the singleton instance of TestRegistry. More... | |
struct | ept::tests::Fixture |
Base class for test fixtures. More... | |
struct | ept::tests::FixtureTestCase< FIXTURE > |
Test case that includes a fixture. More... | |
Namespaces | |
ept | |
String functions. | |
ept::tests | |
Macros | |
#define | EPT_TEST_INFO(name) |
Use this to declare a local variable with the given name that will be picked up by tests as extra local info. More... | |
#define | wassert(...) |
Run the given command, raising TestFailed with the appropriate backtrace information if it threw an exception. More... | |
#define | wassert_true(...) wassert(actual(__VA_ARGS__).istrue()) |
Shortcut to check that a given expression returns true. More... | |
#define | wassert_false(...) wassert(actual(__VA_ARGS__).isfalse()) |
Shortcut to check that a given expression returns false. More... | |
#define | wcallchecked(func) |
Call a function returning its result, and raising TestFailed with the appropriate backtrace information if it threw an exception. More... | |
Functions | |
template<typename A > | |
void | ept::tests::assert_true (const A &actual) |
Test function that ensures that the actual value is true. More... | |
void | ept::tests::assert_true (std::nullptr_t actual) |
template<typename A > | |
void | ept::tests::assert_false (const A &actual) |
Test function that ensures that the actual value is false. More... | |
void | ept::tests::assert_false (std::nullptr_t actual) |
template<typename A , typename E > | |
void | ept::tests::assert_equal (const A &actual, const E &expected) |
Test function that ensures that the actual value is the same as a reference one. More... | |
template<typename A , typename E > | |
void | ept::tests::assert_not_equal (const A &actual, const E &expected) |
Test function that ensures that the actual value is different than a reference one. More... | |
template<typename A , typename E > | |
void | ept::tests::assert_less (const A &actual, const E &expected) |
Ensure that the actual value is less than the reference value. More... | |
template<typename A , typename E > | |
void | ept::tests::assert_less_equal (const A &actual, const E &expected) |
Ensure that the actual value is less or equal than the reference value. More... | |
template<typename A , typename E > | |
void | ept::tests::assert_greater (const A &actual, const E &expected) |
Ensure that the actual value is greater than the reference value. More... | |
template<typename A , typename E > | |
void | ept::tests::assert_greater_equal (const A &actual, const E &expected) |
Ensure that the actual value is greather or equal than the reference value. More... | |
void | ept::tests::assert_startswith (const std::string &actual, const std::string &expected) |
Ensure that the string actual starts with expected. More... | |
void | ept::tests::assert_endswith (const std::string &actual, const std::string &expected) |
Ensure that the string actual ends with expected. More... | |
void | ept::tests::assert_contains (const std::string &actual, const std::string &expected) |
Ensure that the string actual contains expected. More... | |
void | ept::tests::assert_not_contains (const std::string &actual, const std::string &expected) |
Ensure that the string actual does not contain expected. More... | |
void | ept::tests::assert_re_matches (const std::string &actual, const std::string &expected) |
Ensure that the string actual matches the extended regular expression expected. More... | |
void | ept::tests::assert_not_re_matches (const std::string &actual, const std::string &expected) |
Ensure that the string actual does not match the extended regular expression expected. More... | |
template<typename A > | |
Actual< A > | ept::tests::actual (const A &actual) |
ActualCString | ept::tests::actual (const char *actual) |
ActualCString | ept::tests::actual (char *actual) |
ActualStdString | ept::tests::actual (const std::string &actual) |
ActualDouble | ept::tests::actual (double actual) |
ActualFunction | ept::tests::actual_function (std::function< void()> actual) |
Variables | |
const ept::tests::LocationInfo | ept_test_location_info |
#define EPT_TEST_INFO | ( | name | ) |
Use this to declare a local variable with the given name that will be picked up by tests as extra local info.
#define wassert | ( | ... | ) |
Run the given command, raising TestFailed with the appropriate backtrace information if it threw an exception.
If the command raises TestFailed, it adds the current stack to its stack information.
Referenced by register_tests(), and ept::tests::ActualFunction::throws().
#define wassert_false | ( | ... | ) | wassert(actual(__VA_ARGS__).isfalse()) |
Shortcut to check that a given expression returns false.
#define wassert_true | ( | ... | ) | wassert(actual(__VA_ARGS__).istrue()) |
Shortcut to check that a given expression returns true.
Referenced by register_tests().
#define wcallchecked | ( | func | ) |
Call a function returning its result, and raising TestFailed with the appropriate backtrace information if it threw an exception.
If the function raises TestFailed, it adds the current stack to its stack information.
const ept::tests::LocationInfo ept_test_location_info |