Skip to content

Commit

Permalink
tests: Use git::copy_tracked_files from test-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Mar 3, 2025
1 parent 846fa7e commit 1e5ef0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ walkdir = "2.2.3"
[dev-dependencies]
rustversion = "1"
tempfile = { version = "3", default-features = false }
test-helper = { features = ["cli", "doc", "git"], git = "https://github.com/taiki-e/test-helper.git", rev = "d2272e8" }
test-helper = { features = ["cli", "doc", "git"], git = "https://github.com/taiki-e/test-helper.git", rev = "f38a7f5" }

[lints]
workspace = true
Expand Down
12 changes: 1 addition & 11 deletions tests/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,7 @@ pub(crate) fn normalize_output(output_path: &Path, args: &[&str]) {
#[track_caller]
pub(crate) fn test_project(model: &str) -> tempfile::TempDir {
let tmpdir = tempfile::tempdir().unwrap();
let workspace_root = tmpdir.path();
let model_path = fixtures_dir().join("crates").join(model);

for (file_name, from) in test_helper::git::ls_files(model_path, &[]) {
let to = &workspace_root.join(file_name);
if !to.parent().unwrap().is_dir() {
fs::create_dir_all(to.parent().unwrap()).unwrap();
}
fs::copy(from, to).unwrap();
}

test_helper::git::copy_tracked_files(fixtures_dir().join("crates").join(model), tmpdir.path());
tmpdir
}

Expand Down

0 comments on commit 1e5ef0e

Please sign in to comment.