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

Add support for TEST_RANGE with exclusive end

If the range is <start, end, step> instead of [start, end, step], the
end value will not be included in the range.

This can be useful if you have a define that defines e.g. the size of
something and you want to use this define as the end value. As the
pre-processor doesn't evalutate expressions (unless you do some macro
magic) you can't specify the range as [0, MY_SIZE - 1, 1]. With this
change you can then instead give the range <0, MY_SIZE, 1>.
This commit is contained in:
Erik Flodin
2021-04-16 12:02:15 +02:00
committed by Erik Flodin
parent 22777c4810
commit 563786f97c
3 changed files with 32 additions and 5 deletions

View File

@@ -89,7 +89,7 @@ void verifyTest(void);
* - define UNITY_SUPPORT_TEST_CASES to include the TEST_CASE macro, though really it's mostly about the runner generator script
* Parameterized Tests
* - you'll want to create a define of TEST_CASE(...) which basically evaluates to nothing
* - you'll want to create a define of TEST_CASE(...) and/or TEST_RANGE(...) which basically evaluates to nothing
* Tests with Arguments
* - you'll want to define UNITY_USE_COMMAND_LINE_ARGS if you have the test runner passing arguments to Unity