diff options
| author | Trevor Gross <tmgross@umich.edu> | 2023-07-03 19:38:55 -0400 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2023-07-04 06:12:17 -0400 |
| commit | b0a18cbadf6cca712471179778bc13bcfb56aef0 (patch) | |
| tree | 71d006e192f86da8f88e5a980545f26f0b781011 /tests/rustdoc/check-source-code-urls-to-def.rs | |
| parent | 0130c3a06e50ebb166655f81997ce28b9e4029b0 (diff) | |
| download | rust-b0a18cbadf6cca712471179778bc13bcfb56aef0.tar.gz rust-b0a18cbadf6cca712471179778bc13bcfb56aef0.zip | |
Update debuginfo test runner to provide more useful output
This change makes debuginfo tests more user friendly. Changes:
- Print all lines that fail to match the patterns instead of just
the first
- Provide better error messages that also say what did match
- Strip leading whitespace from directives so they are not skipped if
indented
- Improve documentation and improve nesting on some related items
As an example, given the following debuginfo test with intentional
fails:
```rust
// from tests/debuginfo/rc_arc.rs
// cdb-command:dx rc,d
// cdb-check:rc,d : 111 [Type: alloc::rc::Rc<i32>]
// cdb-check: [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]
// cdb-check: [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>]
// ...
```
The current output (tested in #113313) only shows the first mismatch:
```
2023-07-04T08:10:00.1939267Z ---- [debuginfo-cdb] tests\debuginfo\rc_arc.rs stdout ----
2023-07-04T08:10:00.1942182Z
2023-07-04T08:10:00.1957463Z error: line not found in debugger output: [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]
2023-07-04T08:10:00.1958272Z status: exit code: 0
```
With this change, you are able to see all failures in that check
group, as well as what parts were successful. The output is now:
```
2023-07-04T09:45:57.2514224Z error: check directive(s) from `C:\a\rust\rust\tests\debuginfo\rc_arc.rs` not found in debugger output. errors:
2023-07-04T09:45:57.2514631Z (rc_arc.rs:31) ` [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]`
2023-07-04T09:45:57.2514908Z (rc_arc.rs:32) ` [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>]`
2023-07-04T09:45:57.2515181Z (rc_arc.rs:41) ` [Reference count] : 21 [Type: core::sync::atomic FAIL::AtomicUsize]`
2023-07-04T09:45:57.2515452Z (rc_arc.rs:50) `dyn_rc,d [Type: alloc::rc::Rc<dyn$<core::fmt FAIL::Debug> >]`
2023-07-04T09:45:57.2515695Z the following subset of check directive(s) was found successfully::
2023-07-04T09:45:57.2516080Z (rc_arc.rs:30) `rc,d : 111 [Type: alloc::rc::Rc<i32>]`
2023-07-04T09:45:57.2516312Z (rc_arc.rs:35) `weak_rc,d : 111 [Type: alloc::rc::Weak<i32>]`
2023-07-04T09:45:57.2516555Z (rc_arc.rs:36) ` [Reference count] : 11 [Type: core::cell::Cell<usize>]`
2023-07-04T09:45:57.2516881Z (rc_arc.rs:37) ` [Weak reference count] : 2 [Type: core::cell::Cell<usize>]`
...
```
Which makes it easier to see what did and didn't succeed without
manual comparison against the source test file.
Diffstat (limited to 'tests/rustdoc/check-source-code-urls-to-def.rs')
0 files changed, 0 insertions, 0 deletions
