philsquared/Catch — Issue #69: Look checker
Author: samaursa
Created: 2012-01-26 05:48:36+00:00
State: open

This is a feature request. If I have the following code:

for (int i = 0; i < 100; ++i)
{
CHECK(someArray[i] == i);
}

I am essentially adding 100 to the test count, when really that is 1 test. What would be really nice, if there is something like this

for (int i = 0; i < 100; ++i)
{
LOOP_CHECK(someArray[i] == i);
}

Which doesn't record 100 successfuls, but only 1 and if it fails, records only 1 fail, rather than 100. And to go even further:

for (int i = 0; i < 100; ++i)
{
LOOP_BREAK(someArray[i] == i);
}

which will break the loop as soon as one test fails (usually if 1 fails, the rest fail as well) so that the other tests run faster and the buildmachine is able to give me the results quicker.