New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML reporter leaves empty file if the process is killed by a signal #663

Closed
horenmar opened this Issue May 21, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@horenmar
Copy link
Member

horenmar commented May 21, 2016

According to the reporter documentation the xml reporter is streaming and thus I would expect at least partial output if the process is killed a by SIGINT. This is true if I run the binary as ./a.out -r xml, but if I run the binary as ./a.out -r xml -o outfile, I end up with an empty file.

In contrast, if I use the default or compact reporter, the output on stdout and in the outfile will be the same, which is a partial output until the signal was encountered.


Using JUnit reporter seems to trigger an assertion:

a.out: ./catch.hpp:8734: virtual void Catch::CumulativeReporterBase::testCaseEnded(const Catch::TestCaseStats &): Assertion `m_sectionStack.size() == 0' failed.
@horenmar

This comment has been minimized.

Copy link
Member

horenmar commented Jan 6, 2017

Strictly speaking this can be worked-around by redirecting std-out, but it should be investigated anyway.

@philsquared

This comment has been minimized.

Copy link
Collaborator

philsquared commented Feb 6, 2017

This is potentially fixed by 84af6bc - but needs testing

@horenmar

This comment has been minimized.

Copy link
Member

horenmar commented Feb 6, 2017

This seems to be fixed, just throwing in std::endls is a bit of hack solution, so I am gonna tag this with revisit.

@Leandros

This comment has been minimized.

Copy link

Leandros commented Mar 5, 2018

Occasionally, I get the same assert triggered on my CI builds:

Assertion failed: m_sectionStack.size() == 0 (../extern/lib/catch2/single_include/catch.hpp: testCaseEnded: 3808)

couldn't reproduce it outside, yet, and rerunning the build usually fixes it.
I'm invoking my test executable with the following arguments:

/path/to/teamcity/_out/tests/a -r junit -s -o /path/to/teamcity/_out/tests/a.junit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment