Skip to content

Commit 7779eb7

Browse files
committed
make junit output more consistent with default format
1 parent 7342213 commit 7779eb7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/test/src/formatters/junit.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ impl<T: Write> JunitFormatter<T> {
2929
impl<T: Write> OutputFormatter for JunitFormatter<T> {
3030
fn write_run_start(&mut self, _test_count: usize) -> io::Result<()> {
3131
// We write xml header on run start
32-
self.write_message(&"<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
32+
self.out.write_all("\n".as_bytes())?;
33+
self.write_message("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
3334
}
3435

3536
fn write_test_start(&mut self, _desc: &TestDesc) -> io::Result<()> {
@@ -133,6 +134,8 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
133134
self.write_message("</testsuite>")?;
134135
self.write_message("</testsuites>")?;
135136

137+
self.out.write_all("\n\n".as_bytes())?;
138+
136139
Ok(state.failed == 0)
137140
}
138141
}

0 commit comments

Comments
 (0)