rust/library
bors 1c6868aa21 Auto merge of #84568 - andoriyu:libtest/junit_formatter, r=yaahc
feat(libtest): Add JUnit formatter

tracking issue: https://github.com/rust-lang/rust/issues/85563

Add an alternative formatter to `libtest`. Formatter produces valid xml that later can be interpreted as JUnit report.

Caveats:

- `timestamp` is required by schema, but every viewer/parser ignores it. Attribute is not set to avoid depending on chrono;
- Running all "suits" (unit tests, doc-tests and integration tests) will produce a mess;
- I couldn't find a way to get integration test binary name, so it's just goes by "integration";

Sample output for unit tests (pretty printed by 3rd party tool):
```
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="13" skipped="1">
    <testcase classname="results::tests" name="test_completed_bad" time="0"/>
    <testcase classname="results::tests" name="suite_started" time="0"/>
    <testcase classname="results::tests" name="suite_ended_ok" time="0"/>
    <testcase classname="results::tests" name="suite_ended_bad" time="0"/>
    <testcase classname="junit::tests" name="test_failed_output" time="0"/>
    <testcase classname="junit::tests" name="test_simple_output" time="0"/>
    <testcase classname="junit::tests" name="test_multiple_outputs" time="0"/>
    <testcase classname="results::tests" name="test_completed_ok" time="0"/>
    <testcase classname="results::tests" name="test_stared" time="0"/>
    <testcase classname="junit::tests" name="test_generate_xml_no_error_single_testsuite" time="0"/>
    <testcase classname="results::tests" name="test_simple_output" time="0"/>
    <testcase classname="test" name="should_panic" time="0"/>
    <system-out/>
    <system-err/>
  </testsuite>
</testsuites>
```

Sample output for integration tests (pretty printed by 3rd party tool):

```
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0">
    <testcase classname="integration" name="test_add" time="0"/>
    <system-out/>
    <system-err/>
  </testsuite>
</testsuites>
```

Sample output for Doc-tests (pretty printed by 3rd party tool):

```
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0">
    <testcase classname="src/lib.rs" name="(line 2)" time="0"/>
    <system-out/>
    <system-err/>
  </testsuite>
</testsuites>
```
2021-05-27 21:14:55 +00:00
..
alloc Auto merge of #85737 - scottmcm:vec-calloc-option-nonzero, r=m-ou-se 2021-05-27 13:05:57 +00:00
backtrace@221483ebaf Update backtrace to 0.3.57 2021-04-25 13:48:03 -07:00
core Rollup merge of #85730 - Smittyvb:iter-min-max-floats, r=m-ou-se 2021-05-27 20:08:21 +02:00
panic_abort android: set abort message 2021-04-09 15:33:43 +02:00
panic_unwind Change 'NULL' to 'null' 2021-05-02 17:46:00 -06:00
proc_macro remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
profiler_builtins Update cc 2021-05-24 23:34:12 +01:00
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rename opensbd to openbsd 2021-05-26 23:17:13 -07:00
stdarch@37d6e18863 Update stdarch to fix x86 byte shift intrinsics 2021-05-20 01:51:05 +01:00
term
test Auto merge of #84568 - andoriyu:libtest/junit_formatter, r=yaahc 2021-05-27 21:14:55 +00:00
unwind Auto merge of #84124 - 12101111:libunwind, r=petrochenkov 2021-05-27 04:08:20 +00:00