1
1
//! Run all tests in a project, similar to `cargo test`, but using the mir interpreter.
2
2
3
+ use std:: convert:: identity;
3
4
use std:: thread:: Builder ;
4
5
use std:: time:: { Duration , Instant } ;
5
6
use std:: { cell:: RefCell , fs:: read_to_string, panic:: AssertUnwindSafe , path:: PathBuf } ;
@@ -159,18 +160,18 @@ impl Tester {
159
160
. stack_size ( 40 * 1024 * 1024 )
160
161
. spawn_scoped ( s, {
161
162
let diagnostic_config = & diagnostic_config;
162
- // let main = std::thread::current();
163
+ let main = std:: thread:: current ( ) ;
163
164
let analysis = self . host . analysis ( ) ;
164
165
let root_file = self . root_file ;
165
166
move || {
166
- // let res = std::panic::catch_unwind(move || {
167
- let res = analysis. full_diagnostics (
168
- diagnostic_config,
169
- ide:: AssistResolveStrategy :: None ,
170
- root_file,
171
- ) ;
172
- // });
173
- // main.unpark();
167
+ let res = std:: panic:: catch_unwind ( move || {
168
+ analysis. full_diagnostics (
169
+ diagnostic_config,
170
+ ide:: AssistResolveStrategy :: None ,
171
+ root_file,
172
+ )
173
+ } ) ;
174
+ main. unpark ( ) ;
174
175
res
175
176
}
176
177
} )
@@ -186,7 +187,7 @@ impl Tester {
186
187
// attempt to cancel the worker, won't work for chalk hangs unfortunately
187
188
self . host . request_cancellation ( ) ;
188
189
}
189
- worker. join ( )
190
+ worker. join ( ) . and_then ( identity )
190
191
} ) ;
191
192
let mut actual = FxHashMap :: default ( ) ;
192
193
let panicked = match res {
0 commit comments