The JUnit output is nice, but I'd like TAP as well. But I think I need a new event, on_tests_begin() that would have a size_t num_tests member that indicates how many tests are planned to have run (but they haven't run yet!)
TAP output is like:
1..2 # The plan is to execute 2 tests
ok 1 # The first test passed
not ok 2 # the second test failed
EOF
The idea of reporting how many tests are planned to execute is that if one test causes the whole executable to abort, anything parsing the output can understand that it is incomplete. e.g. the following can be caught as a failed test run:
1..2
ok 1
EOF
I've already implemented a similar on_suitesbegin() event, since there is a std::vector suites in the runner, but I don't understand the code well enough to make an on_tests_begin(). I suspect each test is simply run as it is encountered and there's no way to count them beforehand. Am I correct about that? Any ideas? In the worst case I can accumulate test results in the TAP reporter state and just output everything at once at the end, but it is less than ideal.
The JUnit output is nice, but I'd like TAP as well. But I think I need a new event, on_tests_begin() that would have a size_t num_tests member that indicates how many tests are planned to have run (but they haven't run yet!)
TAP output is like:
The idea of reporting how many tests are planned to execute is that if one test causes the whole executable to abort, anything parsing the output can understand that it is incomplete. e.g. the following can be caught as a failed test run:
I've already implemented a similar on_suitesbegin() event, since there is a std::vector suites in the runner, but I don't understand the code well enough to make an on_tests_begin(). I suspect each test is simply run as it is encountered and there's no way to count them beforehand. Am I correct about that? Any ideas? In the worst case I can accumulate test results in the TAP reporter state and just output everything at once at the end, but it is less than ideal.