about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-01-14 12:44:39 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-01-14 14:18:11 +0000
commitfd1e824d88e9927326e5a2b4242c53e83b264d07 (patch)
treea0c450cec1f1c31ef1e9c6136ad7a7713ee874e2
parent5e452ba616ab416e1444882ffe52648ae1fbac09 (diff)
downloadrust-fd1e824d88e9927326e5a2b4242c53e83b264d07.tar.gz
rust-fd1e824d88e9927326e5a2b4242c53e83b264d07.zip
Minor changes to the TestRunner::new signature
-rw-r--r--build_system/tests.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/build_system/tests.rs b/build_system/tests.rs
index 4203a3859e1..6c4d0e2e35e 100644
--- a/build_system/tests.rs
+++ b/build_system/tests.rs
@@ -243,8 +243,11 @@ pub(crate) fn run_tests(
     host_compiler: &Compiler,
     target_triple: &str,
 ) {
-    let runner =
-        TestRunner::new(dirs.clone(), host_compiler.triple.clone(), target_triple.to_string());
+    let runner = TestRunner::new(
+        dirs.clone(),
+        target_triple.to_owned(),
+        host_compiler.triple == target_triple,
+    );
 
     if config::get_bool("testsuite.no_sysroot") {
         build_sysroot::build_sysroot(
@@ -297,11 +300,7 @@ struct TestRunner {
 }
 
 impl TestRunner {
-    pub fn new(dirs: Dirs, host_triple: String, target_triple: String) -> Self {
-        let is_native = host_triple == target_triple;
-        let jit_supported =
-            is_native && host_triple.contains("x86_64") && !host_triple.contains("windows");
-
+    pub fn new(dirs: Dirs, target_triple: String, is_native: bool) -> Self {
         let mut target_compiler = Compiler::clif_with_triple(&dirs, target_triple);
         if !is_native {
             target_compiler.set_cross_linker_and_runner();
@@ -320,6 +319,10 @@ impl TestRunner {
             target_compiler.rustflags.push_str(" -Clink-arg=-undefined -Clink-arg=dynamic_lookup");
         }
 
+        let jit_supported = is_native
+            && target_compiler.triple.contains("x86_64")
+            && !target_compiler.triple.contains("windows");
+
         Self { is_native, jit_supported, dirs, target_compiler }
     }