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
universe@390:
Bounded string implementation.
universe@390:
Main UCX Header providing most common definitions.
universe@390:
UcxTest test
Test case.
Definition: test.h:107
universe@390:
int ucx_test_register(UcxTestSuite *suite, UcxTest test)
Registers a test function with the specified test suite.
Definition: test.c:52
universe@390:
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
universe@390:
Structure for the internal list of test cases.
Definition: test.h:104
universe@390:
UcxTestSuite * ucx_test_suite_new()
Creates a new test suite.
Definition: test.c:31
universe@390:
UcxTestList * tests
Internal list of test cases.
Definition: test.h:128
universe@390:
void(* UcxTest)(UcxTestSuite *, FILE *)
Pointer to a test function.
Definition: test.h:98
universe@390:
void ucx_test_suite_free(UcxTestSuite *suite)
Destroys a test suite.
Definition: test.c:42
universe@390:
unsigned int failure
The number of failed tests after the suite has been run.
Definition: test.h:122
universe@390:
UcxTestList * next
Pointer to the next list element.
Definition: test.h:110
universe@390:
A test suite containing multiple test cases.
Definition: test.h:116
universe@390: