Add UI regressions tests for rustdoc --show-coverage option

This commit is contained in:
Guillaume Gomez 2024-11-04 14:46:04 +01:00
parent e9161db5b5
commit 0eff07ee4e
4 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,13 @@
//@ compile-flags: -Z unstable-options --show-coverage --output-format=json
//@ check-pass
mod bar {
/// a
///
/// ```
/// let x = 0;
/// ```
pub struct Foo;
}
pub use bar::Foo;

View File

@ -0,0 +1 @@
{"$DIR/show-coverage-json.rs":{"total":2,"with_docs":1,"total_examples":2,"with_examples":1}}

View File

@ -0,0 +1,13 @@
//@ compile-flags: -Z unstable-options --show-coverage
//@ check-pass
mod bar {
/// a
///
/// ```
/// let x = 0;
/// ```
pub struct Foo;
}
pub use bar::Foo;

View File

@ -0,0 +1,7 @@
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...ests/rustdoc-ui/show-coverage.rs | 1 | 50.0% | 1 | 50.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 1 | 50.0% | 1 | 50.0% |
+-------------------------------------+------------+------------+------------+------------+