91 #define __FUNCTION__ __func__ 116 struct UcxTestSuite {
158 void ucx_test_run(UcxTestSuite* suite, FILE* outstream);
167 #define UCX_TEST(name) void name(UcxTestSuite* _suite_,FILE *_output_) 176 #define UCX_TEST_BEGIN fwrite("Running ", 1, 8, _output_);\ 177 fwrite(__FUNCTION__, 1, strlen(__FUNCTION__), _output_);\ 178 fwrite("... ", 1, 4, _output_);\ 180 if (!setjmp(_env_)) { 190 #define UCX_TEST_ASSERT(condition,message) if (!(condition)) { \ 191 fwrite(message".\n", 1, 2+strlen(message), _output_); \ 192 _suite_->failure++; \ 207 #define UCX_TEST_SUBROUTINE(name,...) void name(UcxTestSuite* _suite_,\ 208 FILE *_output_, jmp_buf _env_, __VA_ARGS__) 224 #define UCX_TEST_CALL_SUBROUTINE(name,...) \ 225 name(_suite_,_output_,_env_,__VA_ARGS__); 234 #define UCX_TEST_END fwrite("success.\n", 1, 9, _output_); _suite_->success++;} unsigned int success
The number of successful tests after the suite has been run.
Definition: test.h:119
Bounded string implementation.
Main UCX Header providing most common definitions.
UcxTest test
Test case.
Definition: test.h:107
int ucx_test_register(UcxTestSuite *suite, UcxTest test)
Registers a test function with the specified test suite.
Definition: test.c:52
void ucx_test_run(UcxTestSuite *suite, FILE *outstream)
Runs a test suite and writes the test log to the specified stream.
Definition: test.c:82
Structure for the internal list of test cases.
Definition: test.h:104
UcxTestSuite * ucx_test_suite_new()
Creates a new test suite.
Definition: test.c:31
UcxTestList * tests
Internal list of test cases.
Definition: test.h:128
void(* UcxTest)(UcxTestSuite *, FILE *)
Pointer to a test function.
Definition: test.h:98
void ucx_test_suite_free(UcxTestSuite *suite)
Destroys a test suite.
Definition: test.c:42
unsigned int failure
The number of failed tests after the suite has been run.
Definition: test.h:122
UcxTestList * next
Pointer to the next list element.
Definition: test.h:110
A test suite containing multiple test cases.
Definition: test.h:116