Introduction
This is an unit test micro-framework written in C language. Supports test cases and test suites. This library is capable of single test case statistics, test suite statistics and over-all statistics. Each test case is recorded in human readable format and tester can determine source of test failure. Test suite is a group of test cases that tests same functionalities or belong together by logic.
Features
Features
- Assertion for every basic type (except wide strings),
- Statistics and info for each failure,
- Statistics and info for each test case,
- Statistics and info for test suite,
- Dynamic adding and removing of tests into suite and suites into test plan.
Theory of Operation
- User includes this file - ut.h,
- User writes test case in form of functions with this format: void {function name}(void),
- In every test case user uses asserts functions which evaluates logical expressions or (not)expected values with real ones and in case of fail records that failure into test case,
- Micro-framework then evaluates test case as failed and adjusts statistics for test case and suite that contains this test case,
Usage
- At the beginning, user has to create test suite(s),
- Then adds test cases to created suites,
- Adds suite to test plan,
- Previous steps are done for each suite(s) and case(s) as necessary,
- Test plan or particular test suite only is then run,
- After every suite is tested, it has to be destroyed by appropriate call.
Changelog
v2.7
- published selftest of the library: two test cases - one with all positive 34 assertions that should pass and one with all 35 negative assertions that should fail
- fixed non-counting some assertions
- added support for comparison of wchar_t
v2.6.2
- fixed warnings and errors that came up from CppCheck
v2.6.1
- fix of documentation bugs only
v2.6
- many bugfixes
- first public release
Note: for older changes please check repository log.