Skip to content

Commit ec14a11

Browse files
Move more code between the run_binary condition since it's only needed in this case
1 parent 615476a commit ec14a11

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

tests/compile/simd-ffi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#![allow(internal_features, non_camel_case_types)]
77
#![crate_type = "lib"]
8+
89
// we can compile to a variety of platforms, because we don't need
910
// cross-compiled standard libraries.
1011
#![feature(no_core, auto_traits)]

tests/lang_tests.rs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,28 @@ fn compile_and_run_cmds(
2323
env_path = format!("/opt/m68k-unknown-linux-gnu/bin:{}", env_path);
2424
compiler.env("PATH", env_path);
2525

26-
let vm_parent_dir = std::env::var("CG_GCC_VM_DIR")
27-
.map(PathBuf::from)
28-
.unwrap_or_else(|_| std::env::current_dir().unwrap());
29-
let vm_dir = "vm";
30-
let exe_filename = exe.file_name().unwrap();
31-
let vm_home_dir = vm_parent_dir.join(vm_dir).join("home");
32-
let vm_exe_path = vm_home_dir.join(exe_filename);
33-
// FIXME(antoyo): panicking here makes the test pass.
34-
let inside_vm_exe_path = PathBuf::from("/home").join(exe_filename);
35-
let mut copy = Command::new("sudo");
36-
copy.arg("cp");
37-
copy.args([exe, &vm_exe_path]);
38-
39-
let mut commands = vec![("Compiler", compiler), ("Copy", copy)];
26+
let mut commands = vec![("Compiler", compiler)];
4027
if run_binary {
28+
let vm_parent_dir = std::env::var("CG_GCC_VM_DIR")
29+
.map(PathBuf::from)
30+
.unwrap_or_else(|_| std::env::current_dir().unwrap());
31+
let vm_dir = "vm";
32+
let exe_filename = exe.file_name().unwrap();
33+
let vm_home_dir = vm_parent_dir.join(vm_dir).join("home");
34+
let vm_exe_path = vm_home_dir.join(exe_filename);
35+
// FIXME(antoyo): panicking here makes the test pass.
36+
let inside_vm_exe_path = PathBuf::from("/home").join(exe_filename);
37+
38+
let mut copy = Command::new("sudo");
39+
copy.arg("cp");
40+
copy.args([exe, &vm_exe_path]);
41+
4142
let mut runtime = Command::new("sudo");
4243
runtime.args(["chroot", vm_dir, "qemu-m68k-static"]);
4344
runtime.arg(inside_vm_exe_path);
4445
runtime.current_dir(vm_parent_dir);
46+
47+
commands.push(("Copy", copy));
4548
commands.push(("Run-time", runtime));
4649
}
4750
commands

0 commit comments

Comments
 (0)