rapidcheck
rapidcheck copied to clipboard
Recommended approach for nested test contexts?
I might be missing something (while relearning modern C++ and Rapidcheck) but is there a recommended way to group tests into named "contexts", something like:
rc::context("equality", []( ) {
rc::check("is symmetric", [](foo x, foo y) {
return (x == y) == (y == x);
});
rc::check("is symmetric", ...});
// ...
});
That may not be valid C++ even if implemented as above but I hope the idea is clear.
RapidCheck in an of itself only provides a very barebones "test framework". If you want something like this, I'd recommend you use something like Catch, Google Test or Boost Test with the respective RapidCheck integration.
Thanks for the hint -- Catch2 might not be a good fit as it's not clear each framework knows what stdout/stderr messages the other is producing. Ditto for --help command line arguments.
Will investigate Google Test and Boost Test.