You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently in the process of pitching my team on using FUZZ_TEST instead of regular old GoogleTest TEST_P. Most of our tests currently use TEST_P, and my goal is to incrementally convert them from TEST_P to FUZZ_TEST keeping the behavior the same other than fuzzing. This means keeping the deterministically-executed values the same, which I plan to do with WithSeeds.
In the case where a TestWithParam is parameterized on a single parameter, TestWithParam does not insist that that single parameter is wrapped in a std::tuple, but WithSeeds does.
GoogleTest provides Combine, which allows taking lists of parameter generators and performing the cartesian product of them, producing all possible combinations of the parameter generator's outputs. To replicate this, it looks like I'll either have to manually generate each possible combination or whittle down the inputs and argue to my team that it's ok.
Ideally, I'd like to do neither of these things. I'd like to just continue passing the same parameter generators I sent into INSTANTIATE_TEST_SUITE_WITH_PARAMS into WithSeeds and have it figure it out. Doing so would make convincing others that I am not introducing regressions much simpler.
The text was updated successfully, but these errors were encountered:
Until that, one option to consider is to keep your existing TEST_P, add your FUZZ_TEST, but factor out the body of the test to a function, so that it's shared by the TEST_P and the FUZZ_TEST.
I'm currently in the process of pitching my team on using
FUZZ_TEST
instead of regular old GoogleTestTEST_P
. Most of our tests currently useTEST_P
, and my goal is to incrementally convert them fromTEST_P
toFUZZ_TEST
keeping the behavior the same other than fuzzing. This means keeping the deterministically-executed values the same, which I plan to do withWithSeeds
.Unfortunately,
WithSeeds
is less flexible than the GoogleTest parameter generators in a number of important ways:In the case where a
TestWithParam
is parameterized on a single parameter,TestWithParam
does not insist that that single parameter is wrapped in astd::tuple
, butWithSeeds
does.GoogleTest
providesCombine
, which allows taking lists of parameter generators and performing the cartesian product of them, producing all possible combinations of the parameter generator's outputs. To replicate this, it looks like I'll either have to manually generate each possible combination or whittle down the inputs and argue to my team that it's ok.Ideally, I'd like to do neither of these things. I'd like to just continue passing the same parameter generators I sent into
INSTANTIATE_TEST_SUITE_WITH_PARAMS
intoWithSeeds
and have it figure it out. Doing so would make convincing others that I am not introducing regressions much simpler.The text was updated successfully, but these errors were encountered: