From 67f9fe6863cede6ca5f41b938e4f3188feb24c65 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 29 May 2023 11:51:37 +0000 Subject: [PATCH] Lazily patch all test projects --- build_system/prepare.rs | 4 ---- build_system/tests.rs | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build_system/prepare.rs b/build_system/prepare.rs index bc249f4cdab3..115575bff51b 100644 --- a/build_system/prepare.rs +++ b/build_system/prepare.rs @@ -18,10 +18,6 @@ pub(crate) fn prepare(dirs: &Dirs, rustc: &Path) { // FIXME do this on the fly? prepare_stdlib(dirs, rustc); - - super::tests::RAND_REPO.patch(dirs); - super::tests::REGEX_REPO.patch(dirs); - super::tests::PORTABLE_SIMD_REPO.patch(dirs); } fn prepare_stdlib(dirs: &Dirs, rustc: &Path) { diff --git a/build_system/tests.rs b/build_system/tests.rs index 5502e2a23c6c..d104efd61e59 100644 --- a/build_system/tests.rs +++ b/build_system/tests.rs @@ -133,6 +133,8 @@ static LIBCORE_TESTS: CargoProject = CargoProject::new(&LIBCORE_TESTS_SRC, "core const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[ TestCase::custom("test.rust-random/rand", &|runner| { + RAND_REPO.patch(&runner.dirs); + RAND.clean(&runner.dirs); if runner.is_native { @@ -168,6 +170,8 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[ } }), TestCase::custom("test.regex-shootout-regex-dna", &|runner| { + REGEX_REPO.patch(&runner.dirs); + REGEX.clean(&runner.dirs); let mut build_cmd = REGEX.build(&runner.target_compiler, &runner.dirs); @@ -200,6 +204,8 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[ } }), TestCase::custom("test.regex", &|runner| { + REGEX_REPO.patch(&runner.dirs); + REGEX.clean(&runner.dirs); if runner.is_native { @@ -216,6 +222,8 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[ } }), TestCase::custom("test.portable-simd", &|runner| { + PORTABLE_SIMD_REPO.patch(&runner.dirs); + PORTABLE_SIMD.clean(&runner.dirs); let mut build_cmd = PORTABLE_SIMD.build(&runner.target_compiler, &runner.dirs);