-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit 92bc467
Rollup merge of #146068 - Zalathar:panic-hook, r=jieyouxu
compiletest: Capture panic messages via a custom panic hook
Currently, output-capture of panic messages relies on special cooperation between `#![feature(internal_output_capture)]` and the default panic hook. That's a problem if we want to perform our own output capture, because the default panic hook won't know about our custom output-capture mechanism.
We can work around that by installing a custom panic hook that prints equivalent panic messages to a buffer instead.
The custom hook is always installed, but delegates to the default panic hook unless a panic-capture buffer has been installed on the current thread. A panic-capture buffer is only installed on compiletest test threads (by the executor), and only if output-capture is enabled.
---
Right now this PR doesn't provide any particular concrete benefits. But it will be essential as part of further efforts to replace compiletest's use of `#![feature(internal_output_capture)]` with our own output-capture mechanism.
r? jieyouxuFile tree
3 files changed
+152
-0
lines changed- src/tools/compiletest/src
3 files changed
+152
-0
lines changedLines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 | + | ||
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
| |||
120 | 121 |
| |
121 | 122 |
| |
122 | 123 |
| |
124 | + | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | ||
123 | 129 |
| |
124 | 130 |
| |
125 | 131 |
| |
| |||
128 | 134 |
| |
129 | 135 |
| |
130 | 136 |
| |
137 | + | ||
138 | + | ||
139 | + | ||
140 | + | ||
141 | + | ||
142 | + | ||
143 | + | ||
131 | 144 |
| |
132 | 145 |
| |
133 | 146 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 | + | ||
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
| |||
493 | 494 |
| |
494 | 495 |
| |
495 | 496 |
| |
497 | + | ||
498 | + | ||
496 | 499 |
| |
497 | 500 |
| |
498 | 501 |
| |
|
Lines changed: 136 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | ||
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | ||
96 | + | ||
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | + | ||
106 | + | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | + | ||
113 | + | ||
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | ||
123 | + | ||
124 | + | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | ||
131 | + | ||
132 | + | ||
133 | + | ||
134 | + | ||
135 | + | ||
136 | + |
0 commit comments