junit: fix typo in comment and don't include output for passes when not requested
This commit is contained in:
parent
610f827261
commit
58537cde06
2 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ fn str_to_cdata(s: &str) -> String {
|
|||
// `<?'` in a CDATA block, so the escaping gets a little weird.
|
||||
let escaped_output = s.replace("]]>", "]]]]><![CDATA[>");
|
||||
let escaped_output = escaped_output.replace("<?", "<]]><![CDATA[?");
|
||||
// We also smuggle newlines as 
 so as to keep all the output on line line
|
||||
// We also smuggle newlines as 
 so as to keep all the output on one line
|
||||
let escaped_output = escaped_output.replace("\n", "]]>
<![CDATA[");
|
||||
// Prune empty CDATA blocks resulting from any escaping
|
||||
let escaped_output = escaped_output.replace("<![CDATA[]]>", "");
|
||||
|
@ -163,7 +163,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
|
|||
test_name,
|
||||
duration.as_secs_f64()
|
||||
))?;
|
||||
if stdout.is_empty() {
|
||||
if stdout.is_empty() || !state.options.display_output {
|
||||
self.write_message("/>")?;
|
||||
} else {
|
||||
self.write_message("><system-out>")?;
|
||||
|
|
|
@ -1 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"><system-out><![CDATA[print from successful test]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>
<![CDATA[thread 'b' panicked at 'assertion failed: false', f.rs:10:5]]>
<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"><system-out><![CDATA[thread 'c' panicked at 'assertion failed: false', f.rs:16:5]]>
<![CDATA[]]></system-out></testcase><system-out/><system-err/></testsuite></testsuites>
|
||||
<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"/><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>
<![CDATA[thread 'b' panicked at 'assertion failed: false', f.rs:10:5]]>
<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>
<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"/><system-out/><system-err/></testsuite></testsuites>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue