File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,15 @@ fn collect_tests_from_dir(config: &Config,
299
299
let file_path = file. path ( ) ;
300
300
debug ! ( "inspecting file {:?}" , file_path. display( ) ) ;
301
301
if is_test ( config, & file_path) {
302
+ // If we find a test foo/bar.rs, we have to build the
303
+ // output directory `$build/foo` so we can write
304
+ // `$build/foo/bar` into it. We do this *now* in this
305
+ // sequential loop because otherwise, if we do it in the
306
+ // tests themselves, they race for the privilege of
307
+ // creating the directories and sometimes fail randomly.
308
+ let build_dir = config. build_base . join ( & relative_dir_path) ;
309
+ fs:: create_dir_all ( & build_dir) . unwrap ( ) ;
310
+
302
311
let paths = TestPaths {
303
312
file : file_path,
304
313
base : base. to_path_buf ( ) ,
You can’t perform that action at this time.
0 commit comments