Adding an option of built-in test variations #31
Unanswered
are-scenic
asked this question in
Ideas
Replies: 1 comment 4 replies
-
Sounds as a good idea to me! The parameter can also be an index in the array of input structures. Regards, |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've noticed that it became quite common by our developers to run the same test on several variants of certain input.
For instance, let's say we have a storage device, which is composed of physical units and there are several configurations based on capacity, i.e. each capacity has a different amount of this physical units. Each configuration might have impact on our specific test. Now, writing a test for each such configuration might seem a little hideous, not to mention redundant duplication. But if we add a new API in addition to
RUN_TEST(_func_)
that would be named something likeRUN_TEST_VECTOR(_func_, _vector_)
, where_vector_
field would assume an argument of array of integers, it would help to prevent this duplication. The_func_
field will require a function that receives an integer as a parameter. This parameter can be used in the test function either as a variation value itself or a pointer to structure with proper input arguments. The macro would call the test-function for each value in the vector and display it along properly. The macro also can have a signature that assumes additional array of names for each test-variation to make print-out more readable.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions