Skip to content

Commit

Permalink
Add --tool=check
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Sep 2, 2023
1 parent 7288262 commit d0b5b66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ function run_build {
timed inapty cargo +$TOOLCHAIN test --no-run --target=$HOST $ARGS
}

function run_check {
inapty cargo +$TOOLCHAIN check --target=$HOST $ARGS
}

function run_asan {
timed cargo +$TOOLCHAIN careful test -Zcareful-sanitizer=address --no-run --target=$HOST $ARGS &> /dev/null
timed inapty cargo +$TOOLCHAIN careful test -Zcareful-sanitizer=address --color=always --no-fail-fast --target=$HOST $ARGS
Expand All @@ -59,6 +63,8 @@ do
cargo +$TOOLCHAIN update &> /dev/null
if [[ $TOOL == "build" ]]; then
run_build
elif [[ $TOOL == "check" ]]; then
run_check
elif [[ $TOOL == "asan" ]]; then
run_asan
elif [[ $TOOL == "miri" ]]; then
Expand Down
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub enum Tool {
Miri,
Asan,
Build,
Check,
}

impl Tool {
Expand All @@ -52,6 +53,7 @@ impl Tool {
Tool::Miri => "miri/raw",
Tool::Asan => "asan/raw",
Tool::Build => "build/raw",
Tool::Check => "check/raw",
}
}

Expand All @@ -64,6 +66,7 @@ impl Tool {
Tool::Miri => "miri/logs",
Tool::Asan => "asan/logs",
Tool::Build => "build/logs",
Tool::Check => "check/logs",
}
}

Expand All @@ -76,6 +79,7 @@ impl Tool {
Tool::Miri => "miri/index.html",
Tool::Asan => "asan/index.html",
Tool::Build => "build/index.html",
Tool::Check => "check/index.html",
}
}
}
Expand All @@ -86,6 +90,7 @@ impl fmt::Display for Tool {
Tool::Miri => "miri",
Tool::Asan => "asan",
Tool::Build => "build",
Tool::Check => "check",
};
f.write_str(s)
}
Expand All @@ -99,6 +104,7 @@ impl FromStr for Tool {
"miri" => Ok(Self::Miri),
"asan" => Ok(Self::Asan),
"build" => Ok(Self::Build),
"check" => Ok(Self::Check),
_ => Err(format!("Invalid tool {}", s)),
}
}
Expand Down

0 comments on commit d0b5b66

Please sign in to comment.