Say I have the following class and parameterized test:
class SimpleTest : public ::testing::Test, public ::testing::WithParamInterface<int> {};
INSTANTIATE_TEST_CASE_P(SimpleTests, SimpleTest, ::testing::Range(1, 10));
TEST_P(SimpleTest, TestGreaterThanZero) {
int i = GetParam();
ASSERT_GT(i, 0);
}
When I run googletest, I get 10 lines of output, one for each parameter in the range.
Now say I want to change my range from 10 to 10 million. If I ran that, I would get 10 million lines of output (which would be way too much). Is there a way I could group all the output for this parameterized test into one, and simply report the first error?
I know I could rewrite my test case to loop through the values and assert on each one, but I was wondering if there was a way to do this from googletest. The reason why this solution isn't optimal is that if I had multiple parameterized tests, I would have to repeat the loop for each one.