diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-04 14:46:04 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-04 14:46:04 +0100 |
| commit | 0eff07ee4ec22e7f83462b4b1a42dc04e9d5570b (patch) | |
| tree | 2d0afe38c907955885e52714e08531f6b45e63d6 /tests | |
| parent | e9161db5b55ee5398e10a6806cb62d67e725278c (diff) | |
| download | rust-0eff07ee4ec22e7f83462b4b1a42dc04e9d5570b.tar.gz rust-0eff07ee4ec22e7f83462b4b1a42dc04e9d5570b.zip | |
Add UI regressions tests for rustdoc `--show-coverage` option
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rustdoc-ui/show-coverage-json.rs | 13 | ||||
| -rw-r--r-- | tests/rustdoc-ui/show-coverage-json.stdout | 1 | ||||
| -rw-r--r-- | tests/rustdoc-ui/show-coverage.rs | 13 | ||||
| -rw-r--r-- | tests/rustdoc-ui/show-coverage.stdout | 7 |
4 files changed, 34 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/show-coverage-json.rs b/tests/rustdoc-ui/show-coverage-json.rs new file mode 100644 index 00000000000..3851e34fe35 --- /dev/null +++ b/tests/rustdoc-ui/show-coverage-json.rs @@ -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; diff --git a/tests/rustdoc-ui/show-coverage-json.stdout b/tests/rustdoc-ui/show-coverage-json.stdout new file mode 100644 index 00000000000..ed5b5a60212 --- /dev/null +++ b/tests/rustdoc-ui/show-coverage-json.stdout @@ -0,0 +1 @@ +{"$DIR/show-coverage-json.rs":{"total":2,"with_docs":1,"total_examples":2,"with_examples":1}} diff --git a/tests/rustdoc-ui/show-coverage.rs b/tests/rustdoc-ui/show-coverage.rs new file mode 100644 index 00000000000..00bb1606a82 --- /dev/null +++ b/tests/rustdoc-ui/show-coverage.rs @@ -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; diff --git a/tests/rustdoc-ui/show-coverage.stdout b/tests/rustdoc-ui/show-coverage.stdout new file mode 100644 index 00000000000..b3b7679771f --- /dev/null +++ b/tests/rustdoc-ui/show-coverage.stdout @@ -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% | ++-------------------------------------+------------+------------+------------+------------+ |
