We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 588d5d1 commit a04b4b6Copy full SHA for a04b4b6
src/compiletest/compiletest.rs
@@ -299,6 +299,15 @@ fn collect_tests_from_dir(config: &Config,
299
let file_path = file.path();
300
debug!("inspecting file {:?}", file_path.display());
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
+
311
let paths = TestPaths {
312
file: file_path,
313
base: base.to_path_buf(),
0 commit comments