summaryrefslogtreecommitdiff
path: root/doc/ci/testing/unit_test_report_examples.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ci/testing/unit_test_report_examples.md')
-rw-r--r--doc/ci/testing/unit_test_report_examples.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/ci/testing/unit_test_report_examples.md b/doc/ci/testing/unit_test_report_examples.md
index 41dfc8fc60b..c63e225a2a7 100644
--- a/doc/ci/testing/unit_test_report_examples.md
+++ b/doc/ci/testing/unit_test_report_examples.md
@@ -274,3 +274,24 @@ phpunit:
reports:
junit: report.xml
```
+
+## Rust
+
+This example uses [cargo2junit](https://crates.io/crates/cargo2junit),
+which is installed in the current directory.
+To retrieve JSON output from `cargo test`, you must enable the nightly compiler.
+
+```yaml
+run unittests:
+ image: rust:latest
+ stage: test
+ before_script:
+ - cargo install --root . cargo2junit
+ script:
+ - cargo test -- -Z unstable-options --format json --report-time | bin/cargo2junit > report.xml
+ artifacts:
+ when: always
+ reports:
+ junit:
+ - report.xml
+```