Helpers for unit tests. More...
Data Structures | |
struct | ec_test |
Macros | |
#define | EC_TEST_REGISTER(t) |
#define | EC_TEST_ERR(fmt, ...) |
#define | EC_TEST_CHECK(cond, fmt, ...) |
#define | EC_TEST_CHECK_PARSE(node, args...) |
#define | EC_TEST_CHECK_COMPLETE(node, args...) |
#define | EC_TEST_CHECK_COMPLETE_PARTIAL(node, args...) |
Typedefs | |
typedef int | ec_test_t(void) |
Functions | |
int | ec_test_register (struct ec_test *test) |
int | ec_test_all (void) |
int | ec_test_one (const char *name) |
int | ec_test_check_parse (struct ec_node *node, int expected,...) |
int | ec_test_check_complete (struct ec_node *node, enum ec_comp_type type,...) |
Helpers for unit tests.
#define EC_TEST_REGISTER | ( | t | ) |
Register a test case.
t | A pointer to a ec_test structure describing the test to be registered. |
Definition at line 32 of file ecoli_test.h.
#define EC_TEST_ERR | ( | fmt, | |
... ) |
Fail a test with a message.
Definition at line 105 of file ecoli_test.h.
#define EC_TEST_CHECK | ( | cond, | |
fmt, | |||
... ) |
Verify a condition or fail a test with a message.
Definition at line 114 of file ecoli_test.h.
#define EC_TEST_CHECK_PARSE | ( | node, | |
args... ) |
node, input, [expected1, expected2, ...]
Definition at line 129 of file ecoli_test.h.
#define EC_TEST_CHECK_COMPLETE | ( | node, | |
args... ) |
Definition at line 141 of file ecoli_test.h.
#define EC_TEST_CHECK_COMPLETE_PARTIAL | ( | node, | |
args... ) |
Definition at line 149 of file ecoli_test.h.
typedef int ec_test_t(void) |
Type of test function. Return 0 on success, -1 on error.
Definition at line 47 of file ecoli_test.h.
int ec_test_register | ( | struct ec_test * | test | ) |
Register a test case.
int ec_test_all | ( | void | ) |
Run all tests.
int ec_test_one | ( | const char * | name | ) |
Run one test.
int ec_test_check_parse | ( | struct ec_node * | node, |
int | expected, | ||
... ) |
expected == -1 means no match