mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 00:15:58 +01:00
Add TEST_MESSAGE for outputting messages without aborting a test and _MESSAGE variant to TEST_PASS collection.
This commit is contained in:
@@ -178,10 +178,12 @@ documentation for specifics.
|
||||
|
||||
## The Assertions in All Their Blessed Glory
|
||||
|
||||
### Basic Fail and Ignore
|
||||
### Basic Fail, Pass and Ignore
|
||||
|
||||
##### `TEST_FAIL()`
|
||||
|
||||
##### `TEST_FAIL_MESSAGE("message")`
|
||||
|
||||
This fella is most often used in special conditions where your test code is
|
||||
performing logic beyond a simple assertion. That is, in practice, `TEST_FAIL()`
|
||||
will always be found inside a conditional code block.
|
||||
@@ -192,13 +194,30 @@ code then verifies as a final step.
|
||||
- Triggering an exception and verifying it (as in Try / Catch / Throw - see the
|
||||
[CException](https://github.com/ThrowTheSwitch/CException) project).
|
||||
|
||||
##### `TEST_PASS()`
|
||||
|
||||
##### `TEST_PASS_MESSAGE("message")`
|
||||
|
||||
This will abort the remainder of the test, but count the test as a pass. Under
|
||||
normal circumstances, it is not necessary to include this macro in your tests...
|
||||
a lack of failure will automatically be counted as a `PASS`. It is occasionally
|
||||
useful for tests with `#ifdef`s and such.
|
||||
|
||||
##### `TEST_IGNORE()`
|
||||
|
||||
##### `TEST_IGNORE_MESSAGE("message")`
|
||||
|
||||
Marks a test case (i.e. function meant to contain test assertions) as ignored.
|
||||
Usually this is employed as a breadcrumb to come back and implement a test case.
|
||||
An ignored test case has effects if other assertions are in the enclosing test
|
||||
case (see Unity documentation for more).
|
||||
|
||||
##### `TEST_MESSAGE(message)`
|
||||
|
||||
This can be useful for outputting `INFO` messages into the Unity output stream
|
||||
without actually ending the test. Like pass and fail messages, it will be output
|
||||
with the filename and line number.
|
||||
|
||||
### Boolean
|
||||
|
||||
##### `TEST_ASSERT (condition)`
|
||||
|
||||
Reference in New Issue
Block a user