Skip to content

Commit

Permalink
Correct style issues found by fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard authored and sylvestre committed Sep 25, 2023
1 parent 92d727c commit c0ad024
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions tests/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ fn compile_cmdline<T: AsRef<OsStr>>(
mut extra_args: Vec<OsString>,
) -> Vec<OsString> {
let mut arg = match compiler {
"gcc" | "clang" | "clang++" | "nvcc" => vec_from!(OsString, exe.as_ref(), "-c", input, "-o", output),
"gcc" | "clang" | "clang++" | "nvcc" => {
vec_from!(OsString, exe.as_ref(), "-c", input, "-o", output)
}
"cl.exe" => vec_from!(OsString, exe, "-c", input, format!("-Fo{}", output)),
_ => panic!("Unsupported compiler: {}", compiler),
};
Expand All @@ -94,8 +96,8 @@ const INPUT_WITH_WHITESPACE_ALT: &str = "test_whitespace_alt.c";
const INPUT_ERR: &str = "test_err.c";
const INPUT_MACRO_EXPANSION: &str = "test_macro_expansion.c";
const INPUT_WITH_DEFINE: &str = "test_with_define.c";
const INPUT_FOR_CUDA_A : &str = "test_a.cu";
const INPUT_FOR_CUDA_B : &str = "test_b.cu";
const INPUT_FOR_CUDA_A: &str = "test_a.cu";
const INPUT_FOR_CUDA_B: &str = "test_b.cu";
const OUTPUT: &str = "test.o";

// Copy the source files into the tempdir so we can compile with relative paths, since the commandline winds up in the hash key.
Expand Down Expand Up @@ -450,7 +452,6 @@ fn run_sccache_command_tests(compiler: Compiler, tempdir: &Path) {
}
}


fn test_cuda_compiles(compiler: Compiler, tempdir: &Path) {
let Compiler {
name,
Expand All @@ -464,7 +465,13 @@ fn test_cuda_compiles(compiler: Compiler, tempdir: &Path) {
let out_file = tempdir.join(OUTPUT);
trace!("compile A");
sccache_command()
.args(&compile_cmdline(name, &exe, INPUT_FOR_CUDA_A, OUTPUT, Vec::new()))
.args(&compile_cmdline(
name,
&exe,
INPUT_FOR_CUDA_A,
OUTPUT,
Vec::new(),
))
.current_dir(tempdir)
.envs(env_vars.clone())
.assert()
Expand All @@ -481,7 +488,13 @@ fn test_cuda_compiles(compiler: Compiler, tempdir: &Path) {
trace!("compile A");
fs::remove_file(&out_file).unwrap();
sccache_command()
.args(&compile_cmdline(name, &exe, INPUT_FOR_CUDA_A, OUTPUT, Vec::new()))
.args(&compile_cmdline(
name,
&exe,
INPUT_FOR_CUDA_A,
OUTPUT,
Vec::new(),
))
.current_dir(tempdir)
.envs(env_vars.clone())
.assert()
Expand All @@ -500,7 +513,13 @@ fn test_cuda_compiles(compiler: Compiler, tempdir: &Path) {
// phase is correctly running and outputing text
trace!("compile B");
sccache_command()
.args(&compile_cmdline(name, &exe, INPUT_FOR_CUDA_B, OUTPUT, Vec::new()))
.args(&compile_cmdline(
name,
&exe,
INPUT_FOR_CUDA_B,
OUTPUT,
Vec::new(),
))
.current_dir(tempdir)
.envs(env_vars)
.assert()
Expand All @@ -517,7 +536,6 @@ fn test_cuda_compiles(compiler: Compiler, tempdir: &Path) {
});
}


fn run_sccache_cuda_command_tests(compiler: Compiler, tempdir: &Path) {
test_cuda_compiles(compiler, tempdir);
}
Expand Down

0 comments on commit c0ad024

Please sign in to comment.