1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

Adding possibility for automatically defining

TEST_CASE & TEST_RANGE macros
This commit is contained in:
Alex Overchenko
2022-11-27 13:05:13 +03:00
parent 67ca5c57c9
commit 4d5ed3d68b
3 changed files with 47 additions and 9 deletions

View File

@@ -438,6 +438,30 @@ This will rarely be necessary. Most often, Unity will automatically detect if th
In the event that the compiler supports variadic macros, but is primarily C89 (ANSI), defining this option will allow you to use them.
This option is also not necessary when using Ceedling or the test runner generator script.
#### `UNITY_INCLUDE_PARAM_TESTING_MACRO`
Unity can automatically define all supported parameterized tests macros.
To enable that feature, use the following example:
```C
#define UNITY_INCLUDE_PARAM_TESTING_MACRO
```
You can manually provide required `TEST_CASE` or `TEST_RANGE` macro definitions
before including `unity.h`, and they won't be redefined.
If you provide one of the following macros, some of default definitions will not be
defined:
| User defines macro | Unity will __not__ define following macro |
|---|---|
| `UNITY_NOT_DEFINE_TEST_CASE` | `TEST_CASE` |
| `UNITY_NOT_DEFINE_TEST_RANGE` | `TEST_RANGE` |
| `TEST_CASE` | `TEST_CASE` |
| `TEST_RANGE` | `TEST_RANGE` |
_Note:_
That feature requires variadic macro support by compiler. If required feature
is not detected, it will not be enabled, even though preprocessor macro is defined.
## Getting Into The Guts
There will be cases where the options above aren't quite going to get everything perfect.