Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down