Commit Graph

14 Commits (4db0ec48c3e137c60b715246bb0880c52204ce6a)

Author SHA1 Message Date
Martin Kojtal 4db0ec48c3 Case - add control handler check to is_empty() 2016-04-28 15:19:41 -05:00
Niklas Hauser d5c8b80e73 Replace `repeat_count` with `call_count`.
This aims to reduce confusion over repeat vs. call counting, and
the resulting off-by-one error due to different user expectations.
2016-04-28 15:19:13 -05:00
Niklas Hauser c2343b223b Update namespace from v0 to v1. 2016-04-28 15:18:08 -05:00
Niklas Hauser 13987f8101 Adapt include path for header file move to `utest`. 2016-04-28 15:17:55 -05:00
Niklas Hauser 97bbff7ab2 Refactor namespace `mbed::test` to `utest`. 2016-04-28 15:17:43 -05:00
Niklas Hauser dc4cb4585c Unify `Case` and `AsyncCase` using return type.
By letting the test case return a `control_t` type, it can decide itself
if it repeats, and what timeouts are required.
This removes the `AsyncCase` and allows a uniform declaration of test
cases.
2016-04-28 15:17:34 -05:00
Niklas Hauser b119cb2280 Case: `timeout_ms` is unsigned, use 0 as do-not-use indicator. 2016-04-28 15:17:18 -05:00
Niklas Hauser a045c44f78 Refactor `set_up` to `setup`, `tear_down` to `teardown`. It's a verb vs. noun thing. 2016-04-28 15:17:14 -05:00
Niklas Hauser b3e30294cc Overload the (Async-)Case class to take the handlers in a semantically meaningful way. 2016-04-28 15:17:01 -05:00
Niklas Hauser e2a5d97f77 Harness: Add empty test case detection. 2016-04-28 15:16:44 -05:00
Niklas Hauser 171033622b Move types and classes into seperate header files. Rename TestHarness to Harness. 2016-04-28 15:16:12 -05:00
Niklas Hauser 9f770f8ec8 This commits gets rid of all dependencies on unity.
Failures will not longjmp, but are reported on top of the stack,
by calling the case failure handler, which then decides whether to
continue or abort testing.

Other changes:

- Individual cases can have their own setup and teardown handlers,
- Case repeats are now handled by the case handler returning `control_flow_t`,
- Separates `status_t` and `failure_t`,
- Implements useful default case setup and teardown, and
- Keeps score of passes and failures on per case and test basis.
2016-04-28 15:16:04 -05:00
Niklas Hauser eef649e498 Remove return type from case handler.
Use AsyncCase constructor to signal waiting for a async callback.
2016-04-28 15:16:00 -05:00
Niklas Hauser e4354b2c1a Add interface and implementation of a list based unit test harness. 2016-04-28 15:15:56 -05:00