rapidcheck
rapidcheck copied to clipboard
Add Support for Gtest Typed Tests
This is what I've been toying around with for now:
#define RC_GTEST_TYPED_PROP(CaseName, TestName, ArgList) \
template<typename TypeParam> void rapidCheck_propImpl_##CaseName##_##TestName ArgList; \
TYPED_TEST(CaseName, TestName) { ::rc::detail::checkGTest(&rapidCheck_propImpl_##CaseName##_##TestName<TypeParam>); } \
template<typename TypeParam> void rapidCheck_propImpl_##CaseName##_##TestName ArgList
template <typename T> class FooTest : public ::testing::Test {};
using FooTestTypes = ::testing::Types<int8_t,int16_t,int32_t,int64_t>;
TYPED_TEST_CASE(FooTest, FooTestTypes);
// just nonsense examples
RC_GTEST_TYPED_PROP(FooTest, Prop1, (TypeParam x)) { RC_ASSERT(x == x); }
RC_GTEST_TYPED_PROP(FooTest, Prop2, (TypeParam x)) { RC_ASSERT(x != x); }
I can update as I find issues.