Open kalaracey opened 2 years ago
Hey, thanks for the great library. I was wondering if it's possible to set RC_PARAMS with the GoogleTest integration from within the test. I tried setting the environment variable in my test suite constructor to no avail:
#include <gtest/gtest.h> #include <cstdlib> #include <rapidcheck/gtest.h> #include <vector> class TestSuite : public ::testing::Test { protected: TestSuite() { putenv("RC_PARAMS=max_success=100000"); } }; // ... RC_GTEST_FIXTURE_PROP(TestSuite, RapidCheck, (std::vector<int> arg)) { // ... RC_ASSERT(/* ... */); }
The only output from RapidCheck I see is like
Using configuration: seed=13725330511029654191
FWIW, using putenv from main did work, as in
putenv
#include <rapidcheck.h> #include <vector> #include <cstdlib> int main() { putenv("RC_PARAMS=max_success=100000"); rc::check("my property", [](std::vector<int>) { /* ... */ }); return 0; }
With that, I see
Using configuration: max_success=100000 seed=3088896386735555752 - my property OK, passed 100000 tests
Thanks.
Updated original post to use RC_GTEST_FIXTURE_PROP rather than RC_GTEST_PROP.
Hey, thanks for the great library. I was wondering if it's possible to set RC_PARAMS with the GoogleTest integration from within the test. I tried setting the environment variable in my test suite constructor to no avail:
The only output from RapidCheck I see is like
FWIW, using
putenv
from main did work, as inWith that, I see
Thanks.