@@ -147,10 +147,7 @@ pub fn run_tests(config: Config) {
147
147
eprintln ! ( ) ;
148
148
eprintln ! ( "command: {:?}" , miri) ;
149
149
eprintln ! ( ) ;
150
- // `None` means never dump, as we already dumped it for an `OutputDiffers`
151
- // `Some(false)` means there's no reason to dump, as all errors are independent of the stderr
152
- // `Some(true)` means that there was a pattern in the .rs file that was not found in the output.
153
- let mut dump_stderr = Some ( false ) ;
150
+ let mut dump_stderr = true ;
154
151
for error in errors {
155
152
match error {
156
153
Error :: ExitStatus ( mode, exit_status) => eprintln ! ( "{mode:?} got {exit_status}" ) ,
@@ -160,7 +157,6 @@ pub fn run_tests(config: Config) {
160
157
"expected because of pattern here: {}:{definition_line}" ,
161
158
path. display( ) . to_string( ) . bold( )
162
159
) ;
163
- dump_stderr = dump_stderr. map ( |_| true ) ;
164
160
}
165
161
Error :: NoPatternsFound => {
166
162
eprintln ! ( "{}" , "no error patterns found in failure test" . red( ) ) ;
@@ -169,7 +165,7 @@ pub fn run_tests(config: Config) {
169
165
eprintln ! ( "{}" , "error pattern found in success test" . red( ) ) ,
170
166
Error :: OutputDiffers { path, actual, expected } => {
171
167
if path. extension ( ) . unwrap ( ) == "stderr" {
172
- dump_stderr = None ;
168
+ dump_stderr = false ;
173
169
}
174
170
eprintln ! ( "actual output differed from expected {}" , path. display( ) ) ;
175
171
eprintln ! ( "{}" , pretty_assertions:: StrComparison :: new( expected, actual) ) ;
@@ -203,7 +199,8 @@ pub fn run_tests(config: Config) {
203
199
}
204
200
eprintln ! ( ) ;
205
201
}
206
- if let Some ( true ) = dump_stderr {
202
+ // Unless we already dumped the stderr via an OutputDiffers diff, let's dump it here.
203
+ if dump_stderr {
207
204
eprintln ! ( "actual stderr:" ) ;
208
205
eprintln ! ( "{}" , stderr) ;
209
206
eprintln ! ( ) ;
0 commit comments