wibble
1.1
|
#include <string>
#include <sstream>
#include <wibble/tests/tut.h>
#include <wibble/tests/tut_reporter.h>
Go to the source code of this file.
Classes | |
class | wibble::tests::Location |
struct | wibble::tests::LocationInfo |
struct | wibble::tests::TestBool< A > |
struct | wibble::tests::TestEquals< A, E > |
struct | wibble::tests::TestIsLt< A, E > |
struct | wibble::tests::TestIsLte< A, E > |
struct | wibble::tests::TestIsGt< A, E > |
struct | wibble::tests::TestIsGte< A, E > |
struct | wibble::tests::TestStartsWith |
struct | wibble::tests::TestEndsWith |
struct | wibble::tests::TestContains |
struct | wibble::tests::TestRegexp |
struct | wibble::tests::TestFileExists |
struct | wibble::tests::Actual< A > |
struct | wibble::tests::ActualString |
Namespaces | |
wibble | |
wibble::tests | |
Macros | |
#define | TESTGRP(name) |
#define | WIBBLE_TESTS_ALWAYS_THROWS __attribute__ ((noreturn)) |
#define | WIBBLE_TEST_LOCPRM wibble::tests::Location wibble_test_location |
#define | WIBBLE_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 | ensure(x) wibble::tests::impl_ensure(wibble::tests::Location(__FILE__, __LINE__, #x), (x)) |
#define | inner_ensure(x) wibble::tests::impl_ensure(wibble::tests::Location(loc, __FILE__, __LINE__, #x), (x)) |
#define | ensure_equals(x, y) wibble::tests::impl_ensure_equals(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define | inner_ensure_equals(x, y) wibble::tests::impl_ensure_equals(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define | ensure_similar(x, y, prec) wibble::tests::impl_ensure_similar(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y), (prec)) |
#define | inner_ensure_similar(x, y, prec) wibble::tests::impl_ensure_similar(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y), (prec)) |
#define | ensure_contains(x, y) wibble::tests::impl_ensure_contains(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define | inner_ensure_contains(x, y) wibblwibblempl_ensure_contains(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define | ensure_not_contains(x, y) wibble::tests::impl_ensure_not_contains(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define | inner_ensure_not_contains(x, y) wibble::tests::impl_ensure_not_contains(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define | wibble_test_runner(loc, func, ...) |
#define | wrunchecked(func) |
#define | wruntest(test, ...) wibble_test_runner(wibble_test_location.nest(wibble_test_location_info, __FILE__, __LINE__, "function: " #test "(" #__VA_ARGS__ ")"), test, ##__VA_ARGS__) |
#define | wassert(...) wibble_test_runner(wibble_test_location.nest(wibble_test_location_info, __FILE__, __LINE__, #__VA_ARGS__), _wassert, ##__VA_ARGS__) |
Functions | |
void | wibble::tests::impl_ensure (const Location &loc, bool res) |
template<class Actual , class Expected > | |
void | wibble::tests::impl_ensure_equals (const Location &loc, const Actual &actual, const Expected &expected) |
template<class Actual , class Expected , class Precision > | |
void | wibble::tests::impl_ensure_similar (const Location &loc, const Actual &actual, const Expected &expected, const Precision &precision) |
void | wibble::tests::impl_ensure_contains (const wibble::tests::Location &loc, const std::string &haystack, const std::string &needle) |
void | wibble::tests::impl_ensure_not_contains (const wibble::tests::Location &loc, const std::string &haystack, const std::string &needle) |
template<typename A > | |
Actual< A > | wibble::tests::actual (const A &actual) |
ActualString | wibble::tests::actual (const std::string &actual) |
ActualString | wibble::tests::actual (const char *actual) |
ActualString | wibble::tests::actual (char *actual) |
Variables | |
const wibble::tests::Location | wibble_test_location |
const wibble::tests::LocationInfo | wibble_test_location_info |
#define ensure | ( | x | ) | wibble::tests::impl_ensure(wibble::tests::Location(__FILE__, __LINE__, #x), (x)) |
#define ensure_contains | ( | x, | |
y | |||
) | wibble::tests::impl_ensure_contains(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define ensure_equals | ( | x, | |
y | |||
) | wibble::tests::impl_ensure_equals(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define ensure_not_contains | ( | x, | |
y | |||
) | wibble::tests::impl_ensure_not_contains(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define ensure_similar | ( | x, | |
y, | |||
prec | |||
) | wibble::tests::impl_ensure_similar(wibble::tests::Location(__FILE__, __LINE__, #x " == " #y), (x), (y), (prec)) |
#define inner_ensure | ( | x | ) | wibble::tests::impl_ensure(wibble::tests::Location(loc, __FILE__, __LINE__, #x), (x)) |
#define inner_ensure_contains | ( | x, | |
y | |||
) | wibblwibblempl_ensure_contains(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define inner_ensure_equals | ( | x, | |
y | |||
) | wibble::tests::impl_ensure_equals(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define inner_ensure_not_contains | ( | x, | |
y | |||
) | wibble::tests::impl_ensure_not_contains(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y)) |
#define inner_ensure_similar | ( | x, | |
y, | |||
prec | |||
) | wibble::tests::impl_ensure_similar(wibble::tests::Location(loc, __FILE__, __LINE__, #x " == " #y), (x), (y), (prec)) |
#define TESTGRP | ( | name | ) |
#define wassert | ( | ... | ) | wibble_test_runner(wibble_test_location.nest(wibble_test_location_info, __FILE__, __LINE__, #__VA_ARGS__), _wassert, ##__VA_ARGS__) |
#define WIBBLE_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 WIBBLE_TEST_LOCPRM wibble::tests::Location wibble_test_location |
#define wibble_test_runner | ( | loc, | |
func, | |||
... | |||
) |
#define WIBBLE_TESTS_ALWAYS_THROWS __attribute__ ((noreturn)) |
#define wrunchecked | ( | func | ) |
#define wruntest | ( | test, | |
... | |||
) | wibble_test_runner(wibble_test_location.nest(wibble_test_location_info, __FILE__, __LINE__, "function: " #test "(" #__VA_ARGS__ ")"), test, ##__VA_ARGS__) |
|
extern |
Referenced by wibble::tests::TestBool< A >::check(), wibble::tests::TestEquals< A, E >::check(), wibble::tests::TestIsLt< A, E >::check(), wibble::tests::TestIsLte< A, E >::check(), wibble::tests::TestIsGt< A, E >::check(), wibble::tests::TestIsGte< A, E >::check(), wibble::tests::TestStartsWith::check(), wibble::tests::TestEndsWith::check(), wibble::tests::TestContains::check(), wibble::tests::TestRegexp::check(), wibble::tests::TestFileExists::check(), wibble::tests::test_assert_contains(), wibble::tests::test_assert_endswith(), wibble::tests::test_assert_file_exists(), wibble::tests::test_assert_istrue(), wibble::tests::test_assert_not_file_exists(), wibble::tests::test_assert_re_match(), and wibble::tests::test_assert_startswith().
|
extern |