make junit output more consistent with default format

This commit is contained in:
Jane Lusby 2021-09-24 14:45:09 -07:00
parent 73422130ee
commit 7779eb74c8
1 changed files with 4 additions and 1 deletions

View File

@ -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<()> {
@ -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)
}
}