This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit ba37a69
committed
Auto merge of rust-lang#113306 - tgross35:debuginfo-better-output, r=Mark-Simulacrum
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 intentional fail (and a few not shown):
```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 rust-lang#113313) will show:
```
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 chane, 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.File tree
3 files changed
+131
-108
lines changed- src/tools/compiletest/src
- runtest
3 files changed
+131
-108
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
594 | 595 | | |
| 596 | + | |
595 | 597 | | |
596 | 598 | | |
597 | 599 | | |
598 | 600 | | |
599 | | - | |
600 | | - | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
601 | 604 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
| 605 | + | |
| 606 | + | |
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1010 | 1007 | | |
1011 | 1008 | | |
1012 | 1009 | | |
| |||
1023 | 1020 | | |
1024 | 1021 | | |
1025 | 1022 | | |
1026 | | - | |
| 1023 | + | |
1027 | 1024 | | |
1028 | 1025 | | |
1029 | 1026 | | |
1030 | 1027 | | |
1031 | | - | |
| 1028 | + | |
1032 | 1029 | | |
1033 | 1030 | | |
1034 | 1031 | | |
| |||
1058 | 1055 | | |
1059 | 1056 | | |
1060 | 1057 | | |
1061 | | - | |
| 1058 | + | |
1062 | 1059 | | |
1063 | 1060 | | |
1064 | 1061 | | |
| |||
1088 | 1085 | | |
1089 | 1086 | | |
1090 | 1087 | | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1102 | 1096 | | |
1103 | 1097 | | |
1104 | 1098 | | |
| |||
1132 | 1126 | | |
1133 | 1127 | | |
1134 | 1128 | | |
1135 | | - | |
| 1129 | + | |
1136 | 1130 | | |
1137 | | - | |
| 1131 | + | |
1138 | 1132 | | |
1139 | 1133 | | |
1140 | 1134 | | |
1141 | | - | |
| 1135 | + | |
| 1136 | + | |
1142 | 1137 | | |
1143 | 1138 | | |
1144 | 1139 | | |
| |||
1279 | 1274 | | |
1280 | 1275 | | |
1281 | 1276 | | |
1282 | | - | |
| 1277 | + | |
1283 | 1278 | | |
1284 | 1279 | | |
1285 | 1280 | | |
| |||
1315 | 1310 | | |
1316 | 1311 | | |
1317 | 1312 | | |
1318 | | - | |
| 1313 | + | |
1319 | 1314 | | |
1320 | 1315 | | |
1321 | 1316 | | |
| |||
1372 | 1367 | | |
1373 | 1368 | | |
1374 | 1369 | | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
1385 | 1377 | | |
1386 | 1378 | | |
1387 | 1379 | | |
| |||
1430 | 1422 | | |
1431 | 1423 | | |
1432 | 1424 | | |
1433 | | - | |
| 1425 | + | |
1434 | 1426 | | |
1435 | 1427 | | |
1436 | 1428 | | |
1437 | 1429 | | |
1438 | 1430 | | |
1439 | 1431 | | |
1440 | 1432 | | |
1441 | | - | |
| 1433 | + | |
1442 | 1434 | | |
1443 | 1435 | | |
1444 | 1436 | | |
| |||
1458 | 1450 | | |
1459 | 1451 | | |
1460 | 1452 | | |
1461 | | - | |
| 1453 | + | |
1462 | 1454 | | |
1463 | 1455 | | |
1464 | 1456 | | |
| |||
0 commit comments