Merge pull request #3512 from scampi/issue-2724
exit integration test successfully if the crate build failed before applying rustfmt
This commit is contained in:
commit
efa3a62b56
2 changed files with 13 additions and 13 deletions
|
|
@ -42,8 +42,8 @@ function check_fmt_with_lib_tests {
|
|||
|
||||
function check_fmt_base {
|
||||
local test_args="$1"
|
||||
cargo test $test_args
|
||||
if [[ $? != 0 ]]; then
|
||||
local build=$(cargo test $test_args 2>&1)
|
||||
if [[ "$build" =~ "build failed" ]] || [[ "$build" =~ "test result: FAILED." ]]; then
|
||||
return 0
|
||||
fi
|
||||
touch rustfmt.toml
|
||||
|
|
|
|||
|
|
@ -39,17 +39,17 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn test_ignore_path_set() {
|
||||
let config = Config::from_toml(
|
||||
"ignore = [
|
||||
\"foo.rs\",
|
||||
\"bar_dir/*\",
|
||||
]",
|
||||
)
|
||||
.unwrap();
|
||||
let ignore_path_set = IgnorePathSet::from_ignore_list(&config.ignore()).unwrap();
|
||||
match option_env!("CFG_RELEASE_CHANNEL") {
|
||||
// this test requires nightly
|
||||
None | Some("nightly") => {
|
||||
let config = Config::from_toml(r#"ignore = ["foo.rs", "bar_dir/*"]"#).unwrap();
|
||||
let ignore_path_set = IgnorePathSet::from_ignore_list(&config.ignore()).unwrap();
|
||||
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/foo.rs"))));
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("bar_dir/baz.rs"))));
|
||||
assert!(!ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/bar.rs"))));
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/foo.rs"))));
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("bar_dir/baz.rs"))));
|
||||
assert!(!ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/bar.rs"))));
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue