]> git.lizzy.rs Git - rust.git/commitdiff
Copy the test_data/ RLS tests into a writable directory.
authorkennytm <kennytm@gmail.com>
Sat, 28 Jul 2018 19:36:18 +0000 (03:36 +0800)
committerkennytm <kennytm@gmail.com>
Sun, 29 Jul 2018 07:12:47 +0000 (15:12 +0800)
See rust-lang-nursery/rls#966 for details.

src/bootstrap/test.rs

index 7c69197885cf2eaac1f2256809bc35bed9cd0594..24a1dbbde66396c756df043a78cc62974fe27ad0 100644 (file)
@@ -290,6 +290,13 @@ fn run(self, builder: &Builder) {
                                                  "src/tools/rls",
                                                  SourceType::Submodule);
 
+        // Copy `src/tools/rls/test_data` to a writable drive.
+        let test_workspace_path = builder.out.join("rls-test-data");
+        let test_data_path = test_workspace_path.join("test_data");
+        builder.create_dir(&test_data_path);
+        builder.cp_r(&builder.src.join("src/tools/rls/test_data"), &test_data_path);
+        cargo.env("RLS_TEST_WORKSPACE_DIR", test_workspace_path);
+
         builder.add_rustc_lib_path(compiler, &mut cargo);
 
         if try_run(builder, &mut cargo) {