diff options
| author | Eduardo Broto <ebroto@tutanota.com> | 2020-05-25 00:41:13 +0200 |
|---|---|---|
| committer | Eduardo Broto <ebroto@tutanota.com> | 2020-05-31 20:38:48 +0200 |
| commit | 14e9100543166e48acd0ea00233249d2cddf09c2 (patch) | |
| tree | 9b55434aa0a1cff4f77f6d14361b178ede0e2bab | |
| parent | fcc3ed2cdc442b4d3b8f1cb2be5ef7686ff89b3c (diff) | |
| download | rust-14e9100543166e48acd0ea00233249d2cddf09c2.tar.gz rust-14e9100543166e48acd0ea00233249d2cddf09c2.zip | |
cargo-ui tests: check that <dir>/src exists before processing test
| -rw-r--r-- | tests/compile-test.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs index 7bd5f09f333..194354b291f 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -181,8 +181,15 @@ fn run_ui_cargo(config: &mut compiletest::Config) { } let src_path = case.path().join("src"); - env::set_current_dir(&src_path)?; + // When switching between branches, if the previous branch had a test + // that the current branch does not have, the directory is not removed + // because an ignored Cargo.lock file exists. + if !src_path.exists() { + continue; + } + + env::set_current_dir(&src_path)?; for file in fs::read_dir(&src_path)? { let file = file?; if file.file_type()?.is_dir() { |
