Skip to content

Commit

Permalink
make junit output more consistent with default format
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc committed Sep 24, 2021
1 parent 7342213 commit 7779eb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/test/src/formatters/junit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 29,8 @@ impl<T: Write> JunitFormatter<T> {
impl<T: Write> OutputFormatter for JunitFormatter<T> {
fn write_run_start(&mut self, _test_count: usize) -> io::Result<()> {
// We write xml header on run start
self.write_message(&"<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
self.out.write_all("\n".as_bytes())?;
self.write_message("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
}

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

self.out.write_all("\n\n".as_bytes())?;

Ok(state.failed == 0)
}
}
Expand Down

0 comments on commit 7779eb7

Please sign in to comment.