Skip to content
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 broken if test failed with segmentation fault #193

Closed
ptzafrir opened this issue Jun 27, 2019 · 1 comment
Closed

xml reporter broken if test failed with segmentation fault #193

ptzafrir opened this issue Jun 27, 2019 · 1 comment
Labels

Comments

@ptzafrir
Copy link
Contributor

Running the following test

#include <cgreen/cgreen.h>

Describe(test);
BeforeEach(test) {}
AfterEach(test) {}

Ensure(test, segfault_should_produce_valid_junit_report) {
	int *c=0;
	*c=3;
}

compiled with gcc segfault.c -shared -fPIC -lcgreen -o segfault.so && cgreen-runner --xml prefix segfault.so
Produce the following broken xml report

<?xml version="1.0" encoding="ISO-8859-1" ?>
	<testsuite name="segfault-test">
		<testcase classname="segfault/test" name="segfault_should_produce_valid_junit_report">
			<error type="Fatal" message="Test terminated with signal: Segmentation fault">
				<location file="segfault.c" line="7"/>
			</error>
 time="0.10500"> <-- THIS LINE IS BROKEN AND OUT OF ORDER -->
		</testcase>
	</testsuite>
ptzafrir added a commit to ptzafrir/cgreen that referenced this issue Jun 28, 2019
…mentation fault

Change logic for reporting incomplete tests to align with reporting
passing or failing tests. That is store report in temp output file
and dump it to results in xml_report_finish_test when calling
transfer_output_from method.
This way the test time is reported in the correct place on the testcase
tag
ptzafrir added a commit to ptzafrir/cgreen that referenced this issue Jun 28, 2019
…mentation

fault

Change logic for reporting incomplete tests to align with reporting
passing or failing tests. That is store report in temp output file
and dump it to results in xml_report_finish_test when calling
transfer_output_from method.
This way the test time is reported in the correct place on the testcase
tag
thoni56 added a commit that referenced this issue Jun 28, 2019
Fix Issue #193 xml reporter broken if test failed with segfault
@thoni56
Copy link
Contributor

thoni56 commented Jun 28, 2019

Thanks for the report and the fix!

@thoni56 thoni56 closed this as completed Jun 28, 2019
ptzafrir added a commit to ptzafrir/cgreen that referenced this issue Jun 28, 2019
…mentation

fault

Change logic for reporting incomplete tests to align with reporting
passing or failing tests. That is store report in temp output file
and dump it to results in xml_report_finish_test when calling
transfer_output_from method.
This way the test time is reported in the correct place on the testcase
tag
thoni56 pushed a commit that referenced this issue Jul 25, 2019
fault

Change logic for reporting incomplete tests to align with reporting
passing or failing tests. That is store report in temp output file
and dump it to results in xml_report_finish_test when calling
transfer_output_from method.
This way the test time is reported in the correct place on the testcase
tag
@thoni56 thoni56 added the bug label Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants