Skip to content

xml reporter broken if test failed with segmentation fault #193

@ptzafrir

Description

@ptzafrir

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions