| Crates.io | cargo2junit |
| lib.rs | cargo2junit |
| version | 0.1.15 |
| created_at | 2019-02-16 22:58:20.594814+00 |
| updated_at | 2026-01-04 15:34:25.481892+00 |
| description | Converts cargo's json output (from stdin) to JUnit XML (to stdout) |
| homepage | |
| repository | https://github.com/johnterickson/cargo2junit |
| max_upload_size | |
| id | 115262 |
| size | 740,154 |
Converts cargo's json output (from stdin) to JUnit XML (to stdout).
To use, first install:
cargo install cargo2junit
Then, run cargo test either with RUSTC_BOOTSTRAP=1 or with +beta and convert:
RUSTC_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time | cargo2junit > results.xml
Or, use tee for streaming output to console as the tests run:
RUSTC_BOOTSTRAP=1 cargo test -- -Z unstable-options --format json --report-time | tee results.json
cat results.json | cargo2junit > results.xml
Once you have your XML, publish it (e.g. for Azure Pipelines):
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'test_results.xml'
condition: succeededOrFailed()