diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ea4f6232..dd01b50a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,7 +70,7 @@ When the tests run, `cargo test` runs a test suite binary from `target`, which t As a result, attaching a debugger to the test binary will let you see the code that launches the subprocess and that inspects the output, but it won't let you step through cargo-mutants itself, which is probably the most interesting part. -Probably the easiest path is to just make note of the command run by the test, and then run that command yourself, under a debugger, outside of the test suite. For example, `./target/debug/cargo-mutants -d ./testdata/tree/factorial --list`. +Probably the easiest path is to just make note of the command run by the test, and then run that command yourself, under a debugger, outside of the test suite. For example, `./target/debug/cargo-mutants -d ./testdata/factorial --list`. You may wish to turn off the timeouts with `-t 0`. diff --git a/Cargo.toml b/Cargo.toml index 8535bed8..6f575ede 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,35 +98,35 @@ resolver = "2" # so that support for testing workspaces does not try to test the whole # cargo-mutants tree. exclude = [ - "testdata/tree/already_failing_tests", - "testdata/tree/already_hangs", - "testdata/tree/cdylib", - "testdata/tree/cfg_attr_mutants_skip", - "testdata/tree/cfg_attr_test_skip", - "testdata/tree/dependency", - "testdata/tree/diff0", - "testdata/tree/diff1", - "testdata/tree/error_value", - "testdata/tree/everything_skipped", - "testdata/tree/factorial", - "testdata/tree/fails_without_feature", - "testdata/tree/hang_avoided_by_attr/", - "testdata/tree/hang_when_mutated", - "testdata/tree/insta", - "testdata/tree/integration_tests", - "testdata/tree/missing_test", - "testdata/tree/mut_ref", - "testdata/tree/never_type", - "testdata/tree/override_dependency", - "testdata/tree/package-fails/", - "testdata/tree/patch_dependency", - "testdata/tree/relative_dependency", - "testdata/tree/replace_dependency", - "testdata/tree/small_well_tested", - "testdata/tree/strict_warnings", - "testdata/tree/struct_with_no_default", - "testdata/tree/unapply", - "testdata/tree/unsafe", - "testdata/tree/well_tested", - "testdata/tree/with_child_directories", + "testdata/already_failing_tests", + "testdata/already_hangs", + "testdata/cdylib", + "testdata/cfg_attr_mutants_skip", + "testdata/cfg_attr_test_skip", + "testdata/dependency", + "testdata/diff0", + "testdata/diff1", + "testdata/error_value", + "testdata/everything_skipped", + "testdata/factorial", + "testdata/fails_without_feature", + "testdata/hang_avoided_by_attr/", + "testdata/hang_when_mutated", + "testdata/insta", + "testdata/integration_tests", + "testdata/missing_test", + "testdata/mut_ref", + "testdata/never_type", + "testdata/override_dependency", + "testdata/package-fails/", + "testdata/patch_dependency", + "testdata/relative_dependency", + "testdata/replace_dependency", + "testdata/small_well_tested", + "testdata/strict_warnings", + "testdata/struct_with_no_default", + "testdata/unapply", + "testdata/unsafe", + "testdata/well_tested", + "testdata/with_child_directories", ] diff --git a/DESIGN.md b/DESIGN.md index 7367d6e4..3ccd3b59 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -188,7 +188,7 @@ Cargo-mutants is primarily tested on its public interface, which is the command ### `testdata` trees -The primary means of testing is Rust source trees under `testdata/tree`: you can copy an existing tree and modify it to show the new behavior that you want to test. +The primary means of testing is Rust source trees under `testdata`: you can copy an existing tree and modify it to show the new behavior that you want to test. A selection of test trees are available for testing different scenarios. If there is an existing suitable tree, please use it. If you need to test a situation that is not covered yet, please add a new tree. diff --git a/src/build_dir.rs b/src/build_dir.rs index 76573aca..f53c016b 100644 --- a/src/build_dir.rs +++ b/src/build_dir.rs @@ -152,7 +152,7 @@ mod test { #[test] fn build_dir_debug_form() { let options = Options::default(); - let workspace = Workspace::open("testdata/tree/factorial").unwrap(); + let workspace = Workspace::open("testdata/factorial").unwrap(); let build_dir = BuildDir::new(&workspace.dir, &options, &Console::new()).unwrap(); let debug_form = format!("{build_dir:?}"); assert!( diff --git a/src/in_diff.rs b/src/in_diff.rs index 87c1e17e..f90c40f2 100644 --- a/src/in_diff.rs +++ b/src/in_diff.rs @@ -335,8 +335,8 @@ index eb42779..a0091b7 100644 #[test] fn reconstruct_partial_new_file() { - let old = read_to_string("testdata/tree/diff0/src/lib.rs").unwrap(); - let new = read_to_string("testdata/tree/diff1/src/lib.rs").unwrap(); + let old = read_to_string("testdata/diff0/src/lib.rs").unwrap(); + let new = read_to_string("testdata/diff1/src/lib.rs").unwrap(); let diff = make_diff(&old, &new); let patch = Patch::from_single(&diff).unwrap(); let reconstructed = partial_new_file(&patch); diff --git a/src/manifest.rs b/src/manifest.rs index 15b8db8c..15152aba 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -165,7 +165,7 @@ mod test { #[test] fn fix_path_absolute_unchanged() { - let dependency_abspath = Utf8Path::new("testdata/tree/dependency") + let dependency_abspath = Utf8Path::new("testdata/dependency") .canonicalize_utf8() .unwrap(); assert_eq!( @@ -181,13 +181,13 @@ mod test { fn fix_path_relative() { let fixed_path: Utf8PathBuf = super::fix_path( "../dependency", - Utf8Path::new("testdata/tree/relative_dependency"), + Utf8Path::new("testdata/relative_dependency"), ) .expect("path was adjusted") .into(); assert_eq!( &fixed_path, - Utf8Path::new("testdata/tree/relative_dependency/../dependency"), + Utf8Path::new("testdata/relative_dependency/../dependency"), ); } diff --git a/src/mutate.rs b/src/mutate.rs index 4b125f09..2cb2737e 100644 --- a/src/mutate.rs +++ b/src/mutate.rs @@ -208,7 +208,7 @@ mod test { #[test] fn discover_factorial_mutants() { - let tree_path = Utf8Path::new("testdata/tree/factorial"); + let tree_path = Utf8Path::new("testdata/factorial"); let workspace = Workspace::open(tree_path).unwrap(); let options = Options::default(); let mutants = workspace @@ -262,7 +262,7 @@ mod test { #[test] fn filter_by_attributes() { - let mutants = Workspace::open(Utf8Path::new("testdata/tree/hang_avoided_by_attr")) + let mutants = Workspace::open(Utf8Path::new("testdata/hang_avoided_by_attr")) .unwrap() .mutants(&PackageFilter::All, &Options::default(), &Console::new()) .unwrap(); @@ -275,7 +275,7 @@ mod test { #[test] fn mutate_factorial() -> Result<()> { - let tree_path = Utf8Path::new("testdata/tree/factorial"); + let tree_path = Utf8Path::new("testdata/factorial"); let mutants = Workspace::open(tree_path)?.mutants( &PackageFilter::All, &Options::default(), diff --git a/src/workspace.rs b/src/workspace.rs index e0a4a5e1..955fa287 100644 --- a/src/workspace.rs +++ b/src/workspace.rs @@ -317,8 +317,8 @@ mod test { #[test] fn open_subdirectory_of_crate_opens_the_crate() { - let workspace = Workspace::open("testdata/tree/factorial/src") - .expect("open source tree from subdirectory"); + let workspace = + Workspace::open("testdata/factorial/src").expect("open source tree from subdirectory"); let root = &workspace.dir; assert!(root.is_dir()); assert!(root.join("Cargo.toml").is_file()); @@ -328,7 +328,7 @@ mod test { #[test] fn find_root_from_subdirectory_of_workspace_finds_the_workspace_root() { - let root = Workspace::open("testdata/tree/workspace/main") + let root = Workspace::open("testdata/workspace/main") .expect("Find root from within workspace/main") .dir; assert_eq!(root.file_name(), Some("workspace"), "Wrong root: {root:?}"); @@ -336,8 +336,7 @@ mod test { #[test] fn find_top_source_files_from_subdirectory_of_workspace() { - let workspace = - Workspace::open("testdata/tree/workspace/main").expect("Find workspace root"); + let workspace = Workspace::open("testdata/workspace/main").expect("Find workspace root"); assert_eq!( workspace .packages(&PackageFilter::All) @@ -361,7 +360,7 @@ mod test { #[test] fn package_filter_all_from_subdir_gets_everything() { - let subdir_path = Utf8Path::new("testdata/tree/workspace/main"); + let subdir_path = Utf8Path::new("testdata/workspace/main"); let workspace = Workspace::open(subdir_path).expect("Find workspace root"); let packages = workspace.packages(&PackageFilter::All).unwrap(); assert_eq!( @@ -372,7 +371,7 @@ mod test { #[test] fn auto_packages_in_workspace_subdir_finds_single_package() { - let subdir_path = Utf8Path::new("testdata/tree/workspace/main"); + let subdir_path = Utf8Path::new("testdata/workspace/main"); let workspace = Workspace::open(subdir_path).expect("Find workspace root"); let packages = workspace .packages(&PackageFilter::Auto(subdir_path.to_owned())) @@ -382,7 +381,7 @@ mod test { #[test] fn auto_packages_in_virtual_workspace_gets_everything() { - let path = Utf8Path::new("testdata/tree/workspace"); + let path = Utf8Path::new("testdata/workspace"); let workspace = Workspace::open(path).expect("Find workspace root"); let packages = workspace .packages(&PackageFilter::Auto(path.to_owned())) @@ -395,8 +394,7 @@ mod test { #[test] fn filter_by_single_package() { - let workspace = - Workspace::open("testdata/tree/workspace/main").expect("Find workspace root"); + let workspace = Workspace::open("testdata/workspace/main").expect("Find workspace root"); let root_dir = &workspace.dir; assert_eq!( root_dir.file_name(), @@ -426,7 +424,7 @@ mod test { #[test] fn filter_by_multiple_packages() { - let workspace = Workspace::open("testdata/tree/workspace/main").unwrap(); + let workspace = Workspace::open("testdata/workspace/main").unwrap(); assert_eq!( workspace.dir.file_name(), Some("workspace"), diff --git a/testdata/tree/.gitignore b/testdata/.gitignore similarity index 100% rename from testdata/tree/.gitignore rename to testdata/.gitignore diff --git a/testdata/tree/already_failing_doctests/Cargo.toml b/testdata/already_failing_doctests/Cargo.toml similarity index 100% rename from testdata/tree/already_failing_doctests/Cargo.toml rename to testdata/already_failing_doctests/Cargo.toml diff --git a/testdata/tree/already_failing_doctests/src/lib.rs b/testdata/already_failing_doctests/src/lib.rs similarity index 100% rename from testdata/tree/already_failing_doctests/src/lib.rs rename to testdata/already_failing_doctests/src/lib.rs diff --git a/testdata/tree/already_failing_tests/Cargo.toml b/testdata/already_failing_tests/Cargo.toml similarity index 100% rename from testdata/tree/already_failing_tests/Cargo.toml rename to testdata/already_failing_tests/Cargo.toml diff --git a/testdata/tree/already_failing_tests/src/lib.rs b/testdata/already_failing_tests/src/lib.rs similarity index 100% rename from testdata/tree/already_failing_tests/src/lib.rs rename to testdata/already_failing_tests/src/lib.rs diff --git a/testdata/tree/already_hangs/Cargo.toml b/testdata/already_hangs/Cargo.toml similarity index 100% rename from testdata/tree/already_hangs/Cargo.toml rename to testdata/already_hangs/Cargo.toml diff --git a/testdata/tree/already_hangs/src/lib.rs b/testdata/already_hangs/src/lib.rs similarity index 100% rename from testdata/tree/already_hangs/src/lib.rs rename to testdata/already_hangs/src/lib.rs diff --git a/testdata/tree/cdylib/Cargo.toml b/testdata/cdylib/Cargo.toml similarity index 100% rename from testdata/tree/cdylib/Cargo.toml rename to testdata/cdylib/Cargo.toml diff --git a/testdata/tree/cdylib/README.md b/testdata/cdylib/README.md similarity index 100% rename from testdata/tree/cdylib/README.md rename to testdata/cdylib/README.md diff --git a/testdata/tree/cdylib/src/entry.rs b/testdata/cdylib/src/entry.rs similarity index 100% rename from testdata/tree/cdylib/src/entry.rs rename to testdata/cdylib/src/entry.rs diff --git a/testdata/tree/cfg_attr_mutants_skip/Cargo.toml b/testdata/cfg_attr_mutants_skip/Cargo.toml similarity index 100% rename from testdata/tree/cfg_attr_mutants_skip/Cargo.toml rename to testdata/cfg_attr_mutants_skip/Cargo.toml diff --git a/testdata/tree/cfg_attr_mutants_skip/src/lib.rs b/testdata/cfg_attr_mutants_skip/src/lib.rs similarity index 100% rename from testdata/tree/cfg_attr_mutants_skip/src/lib.rs rename to testdata/cfg_attr_mutants_skip/src/lib.rs diff --git a/testdata/tree/cfg_attr_test_skip/Cargo.toml b/testdata/cfg_attr_test_skip/Cargo.toml similarity index 100% rename from testdata/tree/cfg_attr_test_skip/Cargo.toml rename to testdata/cfg_attr_test_skip/Cargo.toml diff --git a/testdata/tree/cfg_attr_test_skip/src/lib.rs b/testdata/cfg_attr_test_skip/src/lib.rs similarity index 100% rename from testdata/tree/cfg_attr_test_skip/src/lib.rs rename to testdata/cfg_attr_test_skip/src/lib.rs diff --git a/testdata/tree/dependency/Cargo.toml b/testdata/dependency/Cargo.toml similarity index 100% rename from testdata/tree/dependency/Cargo.toml rename to testdata/dependency/Cargo.toml diff --git a/testdata/tree/dependency/src/lib.rs b/testdata/dependency/src/lib.rs similarity index 100% rename from testdata/tree/dependency/src/lib.rs rename to testdata/dependency/src/lib.rs diff --git a/testdata/tree/diff0/Cargo.toml b/testdata/diff0/Cargo.toml similarity index 100% rename from testdata/tree/diff0/Cargo.toml rename to testdata/diff0/Cargo.toml diff --git a/testdata/tree/diff0/src/lib.rs b/testdata/diff0/src/lib.rs similarity index 100% rename from testdata/tree/diff0/src/lib.rs rename to testdata/diff0/src/lib.rs diff --git a/testdata/tree/diff1/Cargo.toml b/testdata/diff1/Cargo.toml similarity index 100% rename from testdata/tree/diff1/Cargo.toml rename to testdata/diff1/Cargo.toml diff --git a/testdata/tree/diff1/src/lib.rs b/testdata/diff1/src/lib.rs similarity index 100% rename from testdata/tree/diff1/src/lib.rs rename to testdata/diff1/src/lib.rs diff --git a/testdata/tree/error_value/.cargo/mutants.toml b/testdata/error_value/.cargo/mutants.toml similarity index 100% rename from testdata/tree/error_value/.cargo/mutants.toml rename to testdata/error_value/.cargo/mutants.toml diff --git a/testdata/tree/error_value/Cargo.toml b/testdata/error_value/Cargo.toml similarity index 100% rename from testdata/tree/error_value/Cargo.toml rename to testdata/error_value/Cargo.toml diff --git a/testdata/tree/error_value/README.md b/testdata/error_value/README.md similarity index 100% rename from testdata/tree/error_value/README.md rename to testdata/error_value/README.md diff --git a/testdata/tree/error_value/src/lib.rs b/testdata/error_value/src/lib.rs similarity index 100% rename from testdata/tree/error_value/src/lib.rs rename to testdata/error_value/src/lib.rs diff --git a/testdata/tree/everything_skipped/Cargo.toml b/testdata/everything_skipped/Cargo.toml similarity index 100% rename from testdata/tree/everything_skipped/Cargo.toml rename to testdata/everything_skipped/Cargo.toml diff --git a/testdata/tree/everything_skipped/src/bin/everything-skipped.rs b/testdata/everything_skipped/src/bin/everything-skipped.rs similarity index 100% rename from testdata/tree/everything_skipped/src/bin/everything-skipped.rs rename to testdata/everything_skipped/src/bin/everything-skipped.rs diff --git a/testdata/tree/factorial/Cargo.toml b/testdata/factorial/Cargo.toml similarity index 100% rename from testdata/tree/factorial/Cargo.toml rename to testdata/factorial/Cargo.toml diff --git a/testdata/tree/factorial/src/bin/factorial.rs b/testdata/factorial/src/bin/factorial.rs similarity index 100% rename from testdata/tree/factorial/src/bin/factorial.rs rename to testdata/factorial/src/bin/factorial.rs diff --git a/testdata/tree/fails_without_feature/Cargo.toml b/testdata/fails_without_feature/Cargo.toml similarity index 100% rename from testdata/tree/fails_without_feature/Cargo.toml rename to testdata/fails_without_feature/Cargo.toml diff --git a/testdata/tree/fails_without_feature/README.md b/testdata/fails_without_feature/README.md similarity index 100% rename from testdata/tree/fails_without_feature/README.md rename to testdata/fails_without_feature/README.md diff --git a/testdata/tree/fails_without_feature/src/bin/factorial.rs b/testdata/fails_without_feature/src/bin/factorial.rs similarity index 100% rename from testdata/tree/fails_without_feature/src/bin/factorial.rs rename to testdata/fails_without_feature/src/bin/factorial.rs diff --git a/testdata/tree/hang_avoided_by_attr/Cargo.toml b/testdata/hang_avoided_by_attr/Cargo.toml similarity index 100% rename from testdata/tree/hang_avoided_by_attr/Cargo.toml rename to testdata/hang_avoided_by_attr/Cargo.toml diff --git a/testdata/tree/hang_avoided_by_attr/src/lib.rs b/testdata/hang_avoided_by_attr/src/lib.rs similarity index 100% rename from testdata/tree/hang_avoided_by_attr/src/lib.rs rename to testdata/hang_avoided_by_attr/src/lib.rs diff --git a/testdata/tree/hang_when_mutated/Cargo.toml b/testdata/hang_when_mutated/Cargo.toml similarity index 100% rename from testdata/tree/hang_when_mutated/Cargo.toml rename to testdata/hang_when_mutated/Cargo.toml diff --git a/testdata/tree/hang_when_mutated/src/lib.rs b/testdata/hang_when_mutated/src/lib.rs similarity index 100% rename from testdata/tree/hang_when_mutated/src/lib.rs rename to testdata/hang_when_mutated/src/lib.rs diff --git a/testdata/tree/insta/Cargo.toml b/testdata/insta/Cargo.toml similarity index 100% rename from testdata/tree/insta/Cargo.toml rename to testdata/insta/Cargo.toml diff --git a/testdata/tree/insta/README.md b/testdata/insta/README.md similarity index 100% rename from testdata/tree/insta/README.md rename to testdata/insta/README.md diff --git a/testdata/tree/insta/src/lib.rs b/testdata/insta/src/lib.rs similarity index 100% rename from testdata/tree/insta/src/lib.rs rename to testdata/insta/src/lib.rs diff --git a/testdata/tree/insta/tests/insta.rs b/testdata/insta/tests/insta.rs similarity index 100% rename from testdata/tree/insta/tests/insta.rs rename to testdata/insta/tests/insta.rs diff --git a/testdata/tree/insta/tests/snapshots/insta__say_hello_vs_insta_snapshot.snap b/testdata/insta/tests/snapshots/insta__say_hello_vs_insta_snapshot.snap similarity index 100% rename from testdata/tree/insta/tests/snapshots/insta__say_hello_vs_insta_snapshot.snap rename to testdata/insta/tests/snapshots/insta__say_hello_vs_insta_snapshot.snap diff --git a/testdata/tree/integration_tests/Cargo.toml b/testdata/integration_tests/Cargo.toml similarity index 100% rename from testdata/tree/integration_tests/Cargo.toml rename to testdata/integration_tests/Cargo.toml diff --git a/testdata/tree/integration_tests/README.md b/testdata/integration_tests/README.md similarity index 100% rename from testdata/tree/integration_tests/README.md rename to testdata/integration_tests/README.md diff --git a/testdata/tree/integration_tests/src/lib.rs b/testdata/integration_tests/src/lib.rs similarity index 100% rename from testdata/tree/integration_tests/src/lib.rs rename to testdata/integration_tests/src/lib.rs diff --git a/testdata/tree/integration_tests/tests/api.rs b/testdata/integration_tests/tests/api.rs similarity index 100% rename from testdata/tree/integration_tests/tests/api.rs rename to testdata/integration_tests/tests/api.rs diff --git a/testdata/tree/missing_test/Cargo.toml b/testdata/missing_test/Cargo.toml similarity index 100% rename from testdata/tree/missing_test/Cargo.toml rename to testdata/missing_test/Cargo.toml diff --git a/testdata/tree/missing_test/src/lib.rs b/testdata/missing_test/src/lib.rs similarity index 100% rename from testdata/tree/missing_test/src/lib.rs rename to testdata/missing_test/src/lib.rs diff --git a/testdata/tree/mut_ref/Cargo.toml b/testdata/mut_ref/Cargo.toml similarity index 100% rename from testdata/tree/mut_ref/Cargo.toml rename to testdata/mut_ref/Cargo.toml diff --git a/testdata/tree/mut_ref/README.md b/testdata/mut_ref/README.md similarity index 100% rename from testdata/tree/mut_ref/README.md rename to testdata/mut_ref/README.md diff --git a/testdata/tree/mut_ref/src/lib.rs b/testdata/mut_ref/src/lib.rs similarity index 100% rename from testdata/tree/mut_ref/src/lib.rs rename to testdata/mut_ref/src/lib.rs diff --git a/testdata/tree/never_type/Cargo.toml b/testdata/never_type/Cargo.toml similarity index 100% rename from testdata/tree/never_type/Cargo.toml rename to testdata/never_type/Cargo.toml diff --git a/testdata/tree/never_type/src/lib.rs b/testdata/never_type/src/lib.rs similarity index 100% rename from testdata/tree/never_type/src/lib.rs rename to testdata/never_type/src/lib.rs diff --git a/testdata/tree/nightly_only/Cargo.toml b/testdata/nightly_only/Cargo.toml similarity index 100% rename from testdata/tree/nightly_only/Cargo.toml rename to testdata/nightly_only/Cargo.toml diff --git a/testdata/tree/nightly_only/README.md b/testdata/nightly_only/README.md similarity index 74% rename from testdata/tree/nightly_only/README.md rename to testdata/nightly_only/README.md index e52136d4..d1665098 100644 --- a/testdata/tree/nightly_only/README.md +++ b/testdata/nightly_only/README.md @@ -5,11 +5,11 @@ mutants` uses the corresponding `cargo` and `rustc` when building candidates. For example this should fail: - cargo +stable mutants -d ./testdata/tree/nightly_only/ + cargo +stable mutants -d ./testdata/nightly_only/ and this should succeed: - cargo +nightly mutants -d ./testdata/tree/nightly_only/ + cargo +nightly mutants -d ./testdata/nightly_only/ This isn't covered by an integration test because there's no guarantee the user has both toolchains installed... diff --git a/testdata/tree/nightly_only/src/lib.rs b/testdata/nightly_only/src/lib.rs similarity index 100% rename from testdata/tree/nightly_only/src/lib.rs rename to testdata/nightly_only/src/lib.rs diff --git a/testdata/override_dependency/.cargo/config.toml b/testdata/override_dependency/.cargo/config.toml new file mode 100644 index 00000000..b1e59646 --- /dev/null +++ b/testdata/override_dependency/.cargo/config.toml @@ -0,0 +1 @@ +paths = ["../../mutants_attrs"] diff --git a/testdata/tree/override_dependency/Cargo.toml b/testdata/override_dependency/Cargo.toml similarity index 100% rename from testdata/tree/override_dependency/Cargo.toml rename to testdata/override_dependency/Cargo.toml diff --git a/testdata/tree/override_dependency/src/lib.rs b/testdata/override_dependency/src/lib.rs similarity index 100% rename from testdata/tree/override_dependency/src/lib.rs rename to testdata/override_dependency/src/lib.rs diff --git a/testdata/tree/override_dependency/tests/api.rs b/testdata/override_dependency/tests/api.rs similarity index 100% rename from testdata/tree/override_dependency/tests/api.rs rename to testdata/override_dependency/tests/api.rs diff --git a/testdata/tree/package_fails/Cargo.toml b/testdata/package_fails/Cargo.toml similarity index 100% rename from testdata/tree/package_fails/Cargo.toml rename to testdata/package_fails/Cargo.toml diff --git a/testdata/tree/package_fails/README.md b/testdata/package_fails/README.md similarity index 100% rename from testdata/tree/package_fails/README.md rename to testdata/package_fails/README.md diff --git a/testdata/tree/package_fails/failing/Cargo.toml b/testdata/package_fails/failing/Cargo.toml similarity index 100% rename from testdata/tree/package_fails/failing/Cargo.toml rename to testdata/package_fails/failing/Cargo.toml diff --git a/testdata/tree/package_fails/failing/src/lib.rs b/testdata/package_fails/failing/src/lib.rs similarity index 100% rename from testdata/tree/package_fails/failing/src/lib.rs rename to testdata/package_fails/failing/src/lib.rs diff --git a/testdata/tree/package_fails/passing/Cargo.toml b/testdata/package_fails/passing/Cargo.toml similarity index 100% rename from testdata/tree/package_fails/passing/Cargo.toml rename to testdata/package_fails/passing/Cargo.toml diff --git a/testdata/tree/package_fails/passing/src/lib.rs b/testdata/package_fails/passing/src/lib.rs similarity index 100% rename from testdata/tree/package_fails/passing/src/lib.rs rename to testdata/package_fails/passing/src/lib.rs diff --git a/testdata/tree/parse_fails/Cargo.toml b/testdata/parse_fails/Cargo.toml similarity index 100% rename from testdata/tree/parse_fails/Cargo.toml rename to testdata/parse_fails/Cargo.toml diff --git a/testdata/tree/parse_fails/src/lib.rs b/testdata/parse_fails/src/lib.rs similarity index 100% rename from testdata/tree/parse_fails/src/lib.rs rename to testdata/parse_fails/src/lib.rs diff --git a/testdata/tree/patch_dependency/Cargo.toml b/testdata/patch_dependency/Cargo.toml similarity index 91% rename from testdata/tree/patch_dependency/Cargo.toml rename to testdata/patch_dependency/Cargo.toml index ac8fe47e..2ec603f3 100644 --- a/testdata/tree/patch_dependency/Cargo.toml +++ b/testdata/patch_dependency/Cargo.toml @@ -17,4 +17,4 @@ publish = false mutants = { version = "0" } [patch.crates-io] -"mutants" = { path = "../../../mutants_attrs" } +"mutants" = { path = "../../mutants_attrs" } diff --git a/testdata/tree/patch_dependency/src/lib.rs b/testdata/patch_dependency/src/lib.rs similarity index 100% rename from testdata/tree/patch_dependency/src/lib.rs rename to testdata/patch_dependency/src/lib.rs diff --git a/testdata/tree/patch_dependency/tests/api.rs b/testdata/patch_dependency/tests/api.rs similarity index 100% rename from testdata/tree/patch_dependency/tests/api.rs rename to testdata/patch_dependency/tests/api.rs diff --git a/testdata/tree/relative_dependency/Cargo.toml b/testdata/relative_dependency/Cargo.toml similarity index 100% rename from testdata/tree/relative_dependency/Cargo.toml rename to testdata/relative_dependency/Cargo.toml diff --git a/testdata/tree/relative_dependency/src/lib.rs b/testdata/relative_dependency/src/lib.rs similarity index 100% rename from testdata/tree/relative_dependency/src/lib.rs rename to testdata/relative_dependency/src/lib.rs diff --git a/testdata/tree/relative_dependency/tests/api.rs b/testdata/relative_dependency/tests/api.rs similarity index 100% rename from testdata/tree/relative_dependency/tests/api.rs rename to testdata/relative_dependency/tests/api.rs diff --git a/testdata/tree/replace_dependency/Cargo.toml b/testdata/replace_dependency/Cargo.toml similarity index 90% rename from testdata/tree/replace_dependency/Cargo.toml rename to testdata/replace_dependency/Cargo.toml index a5e6d18d..4c75e615 100644 --- a/testdata/tree/replace_dependency/Cargo.toml +++ b/testdata/replace_dependency/Cargo.toml @@ -17,4 +17,4 @@ publish = false mutants = { version = "0" } [replace] -"mutants:0.0.3" = { path = "../../../mutants_attrs" } +"mutants:0.0.3" = { path = "../../mutants_attrs" } diff --git a/testdata/tree/replace_dependency/src/lib.rs b/testdata/replace_dependency/src/lib.rs similarity index 100% rename from testdata/tree/replace_dependency/src/lib.rs rename to testdata/replace_dependency/src/lib.rs diff --git a/testdata/tree/replace_dependency/tests/api.rs b/testdata/replace_dependency/tests/api.rs similarity index 100% rename from testdata/tree/replace_dependency/tests/api.rs rename to testdata/replace_dependency/tests/api.rs diff --git a/testdata/tree/small_well_tested/Cargo.toml b/testdata/small_well_tested/Cargo.toml similarity index 100% rename from testdata/tree/small_well_tested/Cargo.toml rename to testdata/small_well_tested/Cargo.toml diff --git a/testdata/tree/small_well_tested/src/lib.rs b/testdata/small_well_tested/src/lib.rs similarity index 100% rename from testdata/tree/small_well_tested/src/lib.rs rename to testdata/small_well_tested/src/lib.rs diff --git a/testdata/tree/strict_warnings/Cargo.toml b/testdata/strict_warnings/Cargo.toml similarity index 100% rename from testdata/tree/strict_warnings/Cargo.toml rename to testdata/strict_warnings/Cargo.toml diff --git a/testdata/tree/strict_warnings/src/lib.rs b/testdata/strict_warnings/src/lib.rs similarity index 100% rename from testdata/tree/strict_warnings/src/lib.rs rename to testdata/strict_warnings/src/lib.rs diff --git a/testdata/tree/struct_with_no_default/Cargo.toml b/testdata/struct_with_no_default/Cargo.toml similarity index 100% rename from testdata/tree/struct_with_no_default/Cargo.toml rename to testdata/struct_with_no_default/Cargo.toml diff --git a/testdata/tree/struct_with_no_default/src/lib.rs b/testdata/struct_with_no_default/src/lib.rs similarity index 100% rename from testdata/tree/struct_with_no_default/src/lib.rs rename to testdata/struct_with_no_default/src/lib.rs diff --git a/testdata/tree/override_dependency/.cargo/config.toml b/testdata/tree/override_dependency/.cargo/config.toml deleted file mode 100644 index e9521b28..00000000 --- a/testdata/tree/override_dependency/.cargo/config.toml +++ /dev/null @@ -1 +0,0 @@ -paths = ["../../../mutants_attrs"] diff --git a/testdata/tree/typecheck_fails/Cargo.toml b/testdata/typecheck_fails/Cargo.toml similarity index 100% rename from testdata/tree/typecheck_fails/Cargo.toml rename to testdata/typecheck_fails/Cargo.toml diff --git a/testdata/tree/typecheck_fails/src/lib.rs b/testdata/typecheck_fails/src/lib.rs similarity index 100% rename from testdata/tree/typecheck_fails/src/lib.rs rename to testdata/typecheck_fails/src/lib.rs diff --git a/testdata/tree/unapply/Cargo.toml b/testdata/unapply/Cargo.toml similarity index 100% rename from testdata/tree/unapply/Cargo.toml rename to testdata/unapply/Cargo.toml diff --git a/testdata/tree/unapply/README.md b/testdata/unapply/README.md similarity index 100% rename from testdata/tree/unapply/README.md rename to testdata/unapply/README.md diff --git a/testdata/tree/unapply/src/a.rs b/testdata/unapply/src/a.rs similarity index 100% rename from testdata/tree/unapply/src/a.rs rename to testdata/unapply/src/a.rs diff --git a/testdata/tree/unapply/src/b.rs b/testdata/unapply/src/b.rs similarity index 100% rename from testdata/tree/unapply/src/b.rs rename to testdata/unapply/src/b.rs diff --git a/testdata/tree/unapply/src/c.rs b/testdata/unapply/src/c.rs similarity index 100% rename from testdata/tree/unapply/src/c.rs rename to testdata/unapply/src/c.rs diff --git a/testdata/tree/unapply/src/lib.rs b/testdata/unapply/src/lib.rs similarity index 100% rename from testdata/tree/unapply/src/lib.rs rename to testdata/unapply/src/lib.rs diff --git a/testdata/tree/unsafe/Cargo.toml b/testdata/unsafe/Cargo.toml similarity index 100% rename from testdata/tree/unsafe/Cargo.toml rename to testdata/unsafe/Cargo.toml diff --git a/testdata/tree/unsafe/src/lib.rs b/testdata/unsafe/src/lib.rs similarity index 100% rename from testdata/tree/unsafe/src/lib.rs rename to testdata/unsafe/src/lib.rs diff --git a/testdata/tree/well_tested/Cargo.toml b/testdata/well_tested/Cargo.toml similarity index 100% rename from testdata/tree/well_tested/Cargo.toml rename to testdata/well_tested/Cargo.toml diff --git a/testdata/tree/well_tested/README.md b/testdata/well_tested/README.md similarity index 100% rename from testdata/tree/well_tested/README.md rename to testdata/well_tested/README.md diff --git a/testdata/tree/well_tested/src/arc.rs b/testdata/well_tested/src/arc.rs similarity index 100% rename from testdata/tree/well_tested/src/arc.rs rename to testdata/well_tested/src/arc.rs diff --git a/testdata/tree/well_tested/src/empty_fns.rs b/testdata/well_tested/src/empty_fns.rs similarity index 100% rename from testdata/tree/well_tested/src/empty_fns.rs rename to testdata/well_tested/src/empty_fns.rs diff --git a/testdata/tree/well_tested/src/inside_mod.rs b/testdata/well_tested/src/inside_mod.rs similarity index 100% rename from testdata/tree/well_tested/src/inside_mod.rs rename to testdata/well_tested/src/inside_mod.rs diff --git a/testdata/tree/well_tested/src/item_mod.rs b/testdata/well_tested/src/item_mod.rs similarity index 100% rename from testdata/tree/well_tested/src/item_mod.rs rename to testdata/well_tested/src/item_mod.rs diff --git a/testdata/tree/well_tested/src/lib.rs b/testdata/well_tested/src/lib.rs similarity index 100% rename from testdata/tree/well_tested/src/lib.rs rename to testdata/well_tested/src/lib.rs diff --git a/testdata/tree/well_tested/src/methods.rs b/testdata/well_tested/src/methods.rs similarity index 100% rename from testdata/tree/well_tested/src/methods.rs rename to testdata/well_tested/src/methods.rs diff --git a/testdata/tree/well_tested/src/nested_function.rs b/testdata/well_tested/src/nested_function.rs similarity index 100% rename from testdata/tree/well_tested/src/nested_function.rs rename to testdata/well_tested/src/nested_function.rs diff --git a/testdata/tree/well_tested/src/numbers.rs b/testdata/well_tested/src/numbers.rs similarity index 100% rename from testdata/tree/well_tested/src/numbers.rs rename to testdata/well_tested/src/numbers.rs diff --git a/testdata/tree/well_tested/src/result.rs b/testdata/well_tested/src/result.rs similarity index 100% rename from testdata/tree/well_tested/src/result.rs rename to testdata/well_tested/src/result.rs diff --git a/testdata/tree/well_tested/src/sets.rs b/testdata/well_tested/src/sets.rs similarity index 100% rename from testdata/tree/well_tested/src/sets.rs rename to testdata/well_tested/src/sets.rs diff --git a/testdata/tree/well_tested/src/simple_fns.rs b/testdata/well_tested/src/simple_fns.rs similarity index 100% rename from testdata/tree/well_tested/src/simple_fns.rs rename to testdata/well_tested/src/simple_fns.rs diff --git a/testdata/tree/well_tested/src/slices.rs b/testdata/well_tested/src/slices.rs similarity index 100% rename from testdata/tree/well_tested/src/slices.rs rename to testdata/well_tested/src/slices.rs diff --git a/testdata/tree/well_tested/src/struct_with_lifetime.rs b/testdata/well_tested/src/struct_with_lifetime.rs similarity index 100% rename from testdata/tree/well_tested/src/struct_with_lifetime.rs rename to testdata/well_tested/src/struct_with_lifetime.rs diff --git a/testdata/tree/with_child_directories/Cargo.toml b/testdata/with_child_directories/Cargo.toml similarity index 100% rename from testdata/tree/with_child_directories/Cargo.toml rename to testdata/with_child_directories/Cargo.toml diff --git a/testdata/tree/with_child_directories/README.md b/testdata/with_child_directories/README.md similarity index 100% rename from testdata/tree/with_child_directories/README.md rename to testdata/with_child_directories/README.md diff --git a/testdata/tree/with_child_directories/src/lib.rs b/testdata/with_child_directories/src/lib.rs similarity index 100% rename from testdata/tree/with_child_directories/src/lib.rs rename to testdata/with_child_directories/src/lib.rs diff --git a/testdata/tree/with_child_directories/src/methods.rs b/testdata/with_child_directories/src/methods.rs similarity index 100% rename from testdata/tree/with_child_directories/src/methods.rs rename to testdata/with_child_directories/src/methods.rs diff --git a/testdata/tree/with_child_directories/src/module.rs b/testdata/with_child_directories/src/module.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module.rs rename to testdata/with_child_directories/src/module.rs diff --git a/testdata/tree/with_child_directories/src/module/module_methods.rs b/testdata/with_child_directories/src/module/module_methods.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/module_methods.rs rename to testdata/with_child_directories/src/module/module_methods.rs diff --git a/testdata/tree/with_child_directories/src/module/unreferenced_mod.rs b/testdata/with_child_directories/src/module/unreferenced_mod.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/unreferenced_mod.rs rename to testdata/with_child_directories/src/module/unreferenced_mod.rs diff --git a/testdata/tree/with_child_directories/src/module/utils/inside_mod.rs b/testdata/with_child_directories/src/module/utils/inside_mod.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/utils/inside_mod.rs rename to testdata/with_child_directories/src/module/utils/inside_mod.rs diff --git a/testdata/tree/with_child_directories/src/module/utils/inside_utils_empty_fns.rs b/testdata/with_child_directories/src/module/utils/inside_utils_empty_fns.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/utils/inside_utils_empty_fns.rs rename to testdata/with_child_directories/src/module/utils/inside_utils_empty_fns.rs diff --git a/testdata/tree/with_child_directories/src/module/utils/mod.rs b/testdata/with_child_directories/src/module/utils/mod.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/utils/mod.rs rename to testdata/with_child_directories/src/module/utils/mod.rs diff --git a/testdata/tree/with_child_directories/src/module/utils/nested_function.rs b/testdata/with_child_directories/src/module/utils/nested_function.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/utils/nested_function.rs rename to testdata/with_child_directories/src/module/utils/nested_function.rs diff --git a/testdata/tree/with_child_directories/src/module/utils/sub_utils/mod.rs b/testdata/with_child_directories/src/module/utils/sub_utils/mod.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/utils/sub_utils/mod.rs rename to testdata/with_child_directories/src/module/utils/sub_utils/mod.rs diff --git a/testdata/tree/with_child_directories/src/module/utils/sub_utils/subutils_nested_function.rs b/testdata/with_child_directories/src/module/utils/sub_utils/subutils_nested_function.rs similarity index 100% rename from testdata/tree/with_child_directories/src/module/utils/sub_utils/subutils_nested_function.rs rename to testdata/with_child_directories/src/module/utils/sub_utils/subutils_nested_function.rs diff --git a/testdata/tree/workspace/Cargo.toml b/testdata/workspace/Cargo.toml similarity index 100% rename from testdata/tree/workspace/Cargo.toml rename to testdata/workspace/Cargo.toml diff --git a/testdata/tree/workspace/README.md b/testdata/workspace/README.md similarity index 100% rename from testdata/tree/workspace/README.md rename to testdata/workspace/README.md diff --git a/testdata/tree/workspace/main/Cargo.toml b/testdata/workspace/main/Cargo.toml similarity index 100% rename from testdata/tree/workspace/main/Cargo.toml rename to testdata/workspace/main/Cargo.toml diff --git a/testdata/tree/workspace/main/src/main.rs b/testdata/workspace/main/src/main.rs similarity index 100% rename from testdata/tree/workspace/main/src/main.rs rename to testdata/workspace/main/src/main.rs diff --git a/testdata/tree/workspace/main2/Cargo.toml b/testdata/workspace/main2/Cargo.toml similarity index 100% rename from testdata/tree/workspace/main2/Cargo.toml rename to testdata/workspace/main2/Cargo.toml diff --git a/testdata/tree/workspace/main2/src/main.rs b/testdata/workspace/main2/src/main.rs similarity index 100% rename from testdata/tree/workspace/main2/src/main.rs rename to testdata/workspace/main2/src/main.rs diff --git a/testdata/tree/workspace/utils/Cargo.toml b/testdata/workspace/utils/Cargo.toml similarity index 100% rename from testdata/tree/workspace/utils/Cargo.toml rename to testdata/workspace/utils/Cargo.toml diff --git a/testdata/tree/workspace/utils/src/lib.rs b/testdata/workspace/utils/src/lib.rs similarity index 100% rename from testdata/tree/workspace/utils/src/lib.rs rename to testdata/workspace/utils/src/lib.rs diff --git a/tests/cli/in_diff.rs b/tests/cli/in_diff.rs index bd165c3c..731b5ed6 100644 --- a/tests/cli/in_diff.rs +++ b/tests/cli/in_diff.rs @@ -23,8 +23,8 @@ fn diff_trees_well_tested() { #[test] fn list_mutants_changed_in_diff1() { - let src0 = read_to_string("testdata/tree/diff0/src/lib.rs").unwrap(); - let src1 = read_to_string("testdata/tree/diff1/src/lib.rs").unwrap(); + let src0 = read_to_string("testdata/diff0/src/lib.rs").unwrap(); + let src1 = read_to_string("testdata/diff1/src/lib.rs").unwrap(); let diff = TextDiff::from_lines(&src0, &src1) .unified_diff() .context_radius(2) @@ -70,8 +70,8 @@ fn list_mutants_changed_in_diff1() { /// If the text in the diff doesn't look like the tree then error out. #[test] fn mismatched_diff_causes_error() { - let src0 = read_to_string("testdata/tree/diff0/src/lib.rs").unwrap(); - let src1 = read_to_string("testdata/tree/diff1/src/lib.rs").unwrap(); + let src0 = read_to_string("testdata/diff0/src/lib.rs").unwrap(); + let src1 = read_to_string("testdata/diff1/src/lib.rs").unwrap(); let diff = TextDiff::from_lines(&src0, &src1) .unified_diff() .context_radius(2) diff --git a/tests/cli/main.rs b/tests/cli/main.rs index 3b3bacf9..aa62890c 100644 --- a/tests/cli/main.rs +++ b/tests/cli/main.rs @@ -87,7 +87,7 @@ fn copy_of_testdata(tree_name: &str) -> TempDir { .iter() .all(|p| !path.starts_with(p))) }) - .copy_tree(Path::new("testdata/tree").join(tree_name), &tmp_src_dir) + .copy_tree(Path::new("testdata").join(tree_name), &tmp_src_dir) .unwrap(); tmp_src_dir } @@ -168,7 +168,7 @@ fn list_diff_json_contains_diffs() { "--json", "--diff", "-d", - "testdata/tree/factorial", + "testdata/factorial", ]) .assert() .success(); // needed for lifetime @@ -187,7 +187,7 @@ fn list_diff_json_contains_diffs() { /// Return paths to all testdata trees, in order, excluding leftover git /// detritus with no Cargo.toml. fn all_testdata_tree_paths() -> Vec { - let mut paths: Vec = fs::read_dir("testdata/tree") + let mut paths: Vec = fs::read_dir("testdata") .unwrap() .map(|r| r.unwrap()) .filter(|dir_entry| dir_entry.file_type().unwrap().is_dir()) @@ -245,7 +245,7 @@ fn list_mutants_in_factorial() { run() .arg("mutants") .arg("--list") - .current_dir("testdata/tree/factorial") + .current_dir("testdata/factorial") .assert_insta("list_mutants_in_factorial"); } @@ -255,7 +255,7 @@ fn list_mutants_in_factorial_json() { .arg("mutants") .arg("--list") .arg("--json") - .current_dir("testdata/tree/factorial") + .current_dir("testdata/factorial") .assert_insta("list_mutants_in_factorial_json"); } @@ -307,7 +307,7 @@ fn list_mutants_with_dir_option() { .arg("mutants") .arg("--list") .arg("--dir") - .arg("testdata/tree/factorial") + .arg("testdata/factorial") .assert_insta("list_mutants_with_dir_option"); } @@ -317,7 +317,7 @@ fn list_mutants_with_diffs_in_factorial() { .arg("mutants") .arg("--list") .arg("--diff") - .current_dir("testdata/tree/factorial") + .current_dir("testdata/factorial") .assert_insta("list_mutants_with_diffs_in_factorial"); } @@ -326,7 +326,7 @@ fn list_mutants_well_tested() { run() .arg("mutants") .arg("--list") - .current_dir("testdata/tree/well_tested") + .current_dir("testdata/well_tested") .assert_insta("list_mutants_well_tested"); } @@ -335,7 +335,7 @@ fn list_mutants_well_tested_examine_name_filter() { run() .arg("mutants") .args(["--list", "--file", "nested_function.rs"]) - .current_dir("testdata/tree/well_tested") + .current_dir("testdata/well_tested") .assert_insta("list_mutants_well_tested_examine_name_filter"); } @@ -344,7 +344,7 @@ fn list_mutants_well_tested_exclude_name_filter() { run() .arg("mutants") .args(["--list", "--exclude", "simple_fns.rs"]) - .current_dir("testdata/tree/well_tested") + .current_dir("testdata/well_tested") .assert_insta("list_mutants_well_tested_exclude_name_filter"); } @@ -353,7 +353,7 @@ fn list_mutants_well_tested_exclude_folder_filter() { run() .arg("mutants") .args(["--list", "--exclude", "*/module/*"]) - .current_dir("testdata/tree/with_child_directories") + .current_dir("testdata/with_child_directories") .assert_insta("list_mutants_well_tested_exclude_folder_filter"); } @@ -368,7 +368,7 @@ fn list_mutants_well_tested_examine_and_exclude_name_filter_combined() { "--exclude", "nested_function.rs", ]) - .current_dir("testdata/tree/with_child_directories") + .current_dir("testdata/with_child_directories") .assert_insta("list_mutants_well_tested_examine_and_exclude_name_filter_combined"); } @@ -378,7 +378,7 @@ fn list_mutants_regex_filters() { .arg("mutants") .args(["--list", "--re", "divisible"]) .arg("-d") - .arg("testdata/tree/well_tested") + .arg("testdata/well_tested") .assert_insta("list_mutants_regex_filters"); } @@ -392,7 +392,7 @@ fn list_mutants_regex_anchored_matches_full_line() { r"^src/simple_fns.rs:\d+: replace returns_unit with \(\)$", ]) .arg("-d") - .arg("testdata/tree/well_tested") + .arg("testdata/well_tested") .assert_insta("list_mutants_regex_anchored_matches_full_line"); } @@ -409,7 +409,7 @@ fn list_mutants_regex_filters_json() { "--json", ]) .arg("-d") - .arg("testdata/tree/well_tested") + .arg("testdata/well_tested") .assert_insta("list_mutants_regex_filters_json"); } @@ -429,7 +429,7 @@ fn list_mutants_well_tested_multiple_examine_and_exclude_name_filter_with_files_ run() .arg("mutants") .args(["--list", "--file", "module_methods.rs", "--file", "*/utils/*", "--exclude", "*/sub_utils/*", "--exclude", "nested_function.rs"]) - .current_dir("testdata/tree/with_child_directories") + .current_dir("testdata/with_child_directories") .assert_insta("list_mutants_well_tested_multiple_examine_and_exclude_name_filter_with_files_and_folders"); } @@ -439,7 +439,7 @@ fn list_mutants_json_well_tested() { .arg("mutants") .arg("--list") .arg("--json") - .current_dir("testdata/tree/well_tested") + .current_dir("testdata/well_tested") .assert_insta("list_mutants_json_well_tested"); } @@ -448,7 +448,7 @@ fn list_files_text_well_tested() { run() .arg("mutants") .arg("--list-files") - .current_dir("testdata/tree/well_tested") + .current_dir("testdata/well_tested") .assert_insta("list_files_text_well_tested"); } @@ -459,7 +459,7 @@ fn list_files_respects_file_filters() { run() .arg("mutants") .args(["--list-files", "--exclude", "lib.rs"]) - .current_dir("testdata/tree/well_tested") + .current_dir("testdata/well_tested") .assert() .success() .stdout(predicate::str::contains("methods.rs")) @@ -472,7 +472,7 @@ fn list_files_json_well_tested() { .arg("mutants") .arg("--list-files") .arg("--json") - .current_dir("testdata/tree/well_tested") + .current_dir("testdata/well_tested") .assert_insta("list_files_json_well_tested"); } #[test] @@ -1164,7 +1164,7 @@ fn cargo_mutants_in_override_dependency_tree_passes() { .arg("--no-times") .arg("--no-shuffle") .arg("-d") - .arg("testdata/tree/override_dependency") + .arg("testdata/override_dependency") .assert() .success() .stdout(predicate::function(|stdout| { @@ -1182,7 +1182,7 @@ fn cargo_mutants_in_relative_dependency_tree_passes() { .arg("--no-times") .arg("--no-shuffle") .arg("-d") - .arg("testdata/tree/relative_dependency") + .arg("testdata/relative_dependency") .assert() .success() .stdout(predicate::function(|stdout| { @@ -1200,7 +1200,7 @@ fn cargo_mutants_in_replace_dependency_tree_passes() { .arg("--no-times") .arg("--no-shuffle") .arg("-d") - .arg("testdata/tree/replace_dependency") + .arg("testdata/replace_dependency") .assert() .success() .stdout(predicate::function(|stdout| { @@ -1218,7 +1218,7 @@ fn cargo_mutants_in_patch_dependency_tree_passes() { .arg("--no-times") .arg("--no-shuffle") .arg("-d") - .arg("testdata/tree/patch_dependency") + .arg("testdata/patch_dependency") .assert() .success() .stdout(predicate::function(|stdout| { diff --git a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap index 493298b9..faaff435 100644 --- a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap +++ b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap @@ -2,7 +2,7 @@ source: tests/cli/main.rs expression: buf --- -## testdata/tree/already_failing_doctests +## testdata/already_failing_doctests ```json [ @@ -27,7 +27,7 @@ expression: buf ] ``` -## testdata/tree/already_failing_tests +## testdata/already_failing_tests ```json [ @@ -52,7 +52,7 @@ expression: buf ] ``` -## testdata/tree/already_hangs +## testdata/already_hangs ```json [ @@ -68,7 +68,7 @@ expression: buf ] ``` -## testdata/tree/cdylib +## testdata/cdylib ```json [ @@ -93,13 +93,13 @@ expression: buf ] ``` -## testdata/tree/cfg_attr_mutants_skip +## testdata/cfg_attr_mutants_skip ```json [] ``` -## testdata/tree/cfg_attr_test_skip +## testdata/cfg_attr_test_skip ```json [ @@ -124,7 +124,7 @@ expression: buf ] ``` -## testdata/tree/dependency +## testdata/dependency ```json [ @@ -149,7 +149,7 @@ expression: buf ] ``` -## testdata/tree/diff0 +## testdata/diff0 ```json [ @@ -174,7 +174,7 @@ expression: buf ] ``` -## testdata/tree/diff1 +## testdata/diff1 ```json [ @@ -217,7 +217,7 @@ expression: buf ] ``` -## testdata/tree/error_value +## testdata/error_value ```json [ @@ -251,13 +251,13 @@ expression: buf ] ``` -## testdata/tree/everything_skipped +## testdata/everything_skipped ```json [] ``` -## testdata/tree/factorial +## testdata/factorial ```json [ @@ -291,7 +291,7 @@ expression: buf ] ``` -## testdata/tree/fails_without_feature +## testdata/fails_without_feature ```json [ @@ -316,7 +316,7 @@ expression: buf ] ``` -## testdata/tree/hang_avoided_by_attr +## testdata/hang_avoided_by_attr ```json [ @@ -332,7 +332,7 @@ expression: buf ] ``` -## testdata/tree/hang_when_mutated +## testdata/hang_when_mutated ```json [ @@ -375,7 +375,7 @@ expression: buf ] ``` -## testdata/tree/insta +## testdata/insta ```json [ @@ -400,7 +400,7 @@ expression: buf ] ``` -## testdata/tree/integration_tests +## testdata/integration_tests ```json [ @@ -425,7 +425,7 @@ expression: buf ] ``` -## testdata/tree/missing_test +## testdata/missing_test ```json [ @@ -450,7 +450,7 @@ expression: buf ] ``` -## testdata/tree/mut_ref +## testdata/mut_ref ```json [ @@ -475,13 +475,13 @@ expression: buf ] ``` -## testdata/tree/never_type +## testdata/never_type ```json [] ``` -## testdata/tree/nightly_only +## testdata/nightly_only ```json [ @@ -515,7 +515,7 @@ expression: buf ] ``` -## testdata/tree/override_dependency +## testdata/override_dependency ```json [ @@ -540,7 +540,7 @@ expression: buf ] ``` -## testdata/tree/package_fails +## testdata/package_fails ```json [ @@ -583,7 +583,7 @@ expression: buf ] ``` -## testdata/tree/patch_dependency +## testdata/patch_dependency ```json [ @@ -608,7 +608,7 @@ expression: buf ] ``` -## testdata/tree/relative_dependency +## testdata/relative_dependency ```json [ @@ -633,7 +633,7 @@ expression: buf ] ``` -## testdata/tree/replace_dependency +## testdata/replace_dependency ```json [ @@ -658,7 +658,7 @@ expression: buf ] ``` -## testdata/tree/small_well_tested +## testdata/small_well_tested ```json [ @@ -683,7 +683,7 @@ expression: buf ] ``` -## testdata/tree/strict_warnings +## testdata/strict_warnings ```json [ @@ -708,7 +708,7 @@ expression: buf ] ``` -## testdata/tree/struct_with_no_default +## testdata/struct_with_no_default ```json [ @@ -724,7 +724,7 @@ expression: buf ] ``` -## testdata/tree/typecheck_fails +## testdata/typecheck_fails ```json [ @@ -749,7 +749,7 @@ expression: buf ] ``` -## testdata/tree/unapply +## testdata/unapply ```json [ @@ -837,13 +837,13 @@ expression: buf ] ``` -## testdata/tree/unsafe +## testdata/unsafe ```json [] ``` -## testdata/tree/well_tested +## testdata/well_tested ```json [ @@ -1192,7 +1192,7 @@ expression: buf ] ``` -## testdata/tree/with_child_directories +## testdata/with_child_directories ```json [ @@ -1325,7 +1325,7 @@ expression: buf ] ``` -## testdata/tree/workspace +## testdata/workspace ```json [ diff --git a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap index 9570825e..b1bb0065 100644 --- a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap +++ b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap @@ -2,60 +2,60 @@ source: tests/cli/main.rs expression: buf --- -## testdata/tree/already_failing_doctests +## testdata/already_failing_doctests ``` src/lib.rs:9: replace takes_one_arg -> usize with 0 src/lib.rs:9: replace takes_one_arg -> usize with 1 ``` -## testdata/tree/already_failing_tests +## testdata/already_failing_tests ``` src/lib.rs:1: replace factorial -> u32 with 0 src/lib.rs:1: replace factorial -> u32 with 1 ``` -## testdata/tree/already_hangs +## testdata/already_hangs ``` src/lib.rs:8: replace infinite_loop with () ``` -## testdata/tree/cdylib +## testdata/cdylib ``` src/entry.rs:1: replace factorial -> u32 with 0 src/entry.rs:1: replace factorial -> u32 with 1 ``` -## testdata/tree/cfg_attr_mutants_skip +## testdata/cfg_attr_mutants_skip ``` ``` -## testdata/tree/cfg_attr_test_skip +## testdata/cfg_attr_test_skip ``` src/lib.rs:17: replace double -> usize with 0 src/lib.rs:17: replace double -> usize with 1 ``` -## testdata/tree/dependency +## testdata/dependency ``` src/lib.rs:1: replace factorial -> u32 with 0 src/lib.rs:1: replace factorial -> u32 with 1 ``` -## testdata/tree/diff0 +## testdata/diff0 ``` src/lib.rs:1: replace one -> String with String::new() src/lib.rs:1: replace one -> String with "xyzzy".into() ``` -## testdata/tree/diff1 +## testdata/diff1 ``` src/lib.rs:1: replace one -> String with String::new() @@ -64,7 +64,7 @@ src/lib.rs:5: replace two -> String with String::new() src/lib.rs:5: replace two -> String with "xyzzy".into() ``` -## testdata/tree/error_value +## testdata/error_value ``` src/lib.rs:3: replace even_is_ok -> Result with Ok(0) @@ -72,12 +72,12 @@ src/lib.rs:3: replace even_is_ok -> Result with Ok(1) src/lib.rs:3: replace even_is_ok -> Result with Err("injected") ``` -## testdata/tree/everything_skipped +## testdata/everything_skipped ``` ``` -## testdata/tree/factorial +## testdata/factorial ``` src/bin/factorial.rs:1: replace main with () @@ -85,20 +85,20 @@ src/bin/factorial.rs:7: replace factorial -> u32 with 0 src/bin/factorial.rs:7: replace factorial -> u32 with 1 ``` -## testdata/tree/fails_without_feature +## testdata/fails_without_feature ``` src/bin/factorial.rs:9: replace factorial -> u32 with 0 src/bin/factorial.rs:9: replace factorial -> u32 with 1 ``` -## testdata/tree/hang_avoided_by_attr +## testdata/hang_avoided_by_attr ``` src/lib.rs:14: replace controlled_loop with () ``` -## testdata/tree/hang_when_mutated +## testdata/hang_when_mutated ``` src/lib.rs:12: replace should_stop -> bool with true @@ -107,40 +107,40 @@ src/lib.rs:25: replace controlled_loop -> usize with 0 src/lib.rs:25: replace controlled_loop -> usize with 1 ``` -## testdata/tree/insta +## testdata/insta ``` src/lib.rs:1: replace say_hello -> String with String::new() src/lib.rs:1: replace say_hello -> String with "xyzzy".into() ``` -## testdata/tree/integration_tests +## testdata/integration_tests ``` src/lib.rs:1: replace double -> u32 with 0 src/lib.rs:1: replace double -> u32 with 1 ``` -## testdata/tree/missing_test +## testdata/missing_test ``` src/lib.rs:1: replace is_symlink -> bool with true src/lib.rs:1: replace is_symlink -> bool with false ``` -## testdata/tree/mut_ref +## testdata/mut_ref ``` src/lib.rs:1: replace returns_mut_ref -> &mut u32 with Box::leak(Box::new(0)) src/lib.rs:1: replace returns_mut_ref -> &mut u32 with Box::leak(Box::new(1)) ``` -## testdata/tree/never_type +## testdata/never_type ``` ``` -## testdata/tree/nightly_only +## testdata/nightly_only ``` src/lib.rs:2: replace box_an_int -> Box with Box::new(0) @@ -148,14 +148,14 @@ src/lib.rs:2: replace box_an_int -> Box with Box::new(1) src/lib.rs:2: replace box_an_int -> Box with Box::new(-1) ``` -## testdata/tree/override_dependency +## testdata/override_dependency ``` src/lib.rs:6: replace is_even -> bool with true src/lib.rs:6: replace is_even -> bool with false ``` -## testdata/tree/package_fails +## testdata/package_fails ``` failing/src/lib.rs:1: replace triple -> usize with 0 @@ -164,55 +164,55 @@ passing/src/lib.rs:1: replace triple -> usize with 0 passing/src/lib.rs:1: replace triple -> usize with 1 ``` -## testdata/tree/patch_dependency +## testdata/patch_dependency ``` src/lib.rs:6: replace is_even -> bool with true src/lib.rs:6: replace is_even -> bool with false ``` -## testdata/tree/relative_dependency +## testdata/relative_dependency ``` src/lib.rs:5: replace double_factorial -> u32 with 0 src/lib.rs:5: replace double_factorial -> u32 with 1 ``` -## testdata/tree/replace_dependency +## testdata/replace_dependency ``` src/lib.rs:6: replace is_even -> bool with true src/lib.rs:6: replace is_even -> bool with false ``` -## testdata/tree/small_well_tested +## testdata/small_well_tested ``` src/lib.rs:4: replace factorial -> u32 with 0 src/lib.rs:4: replace factorial -> u32 with 1 ``` -## testdata/tree/strict_warnings +## testdata/strict_warnings ``` src/lib.rs:5: replace some_fn -> usize with 0 src/lib.rs:5: replace some_fn -> usize with 1 ``` -## testdata/tree/struct_with_no_default +## testdata/struct_with_no_default ``` src/lib.rs:11: replace make_an_s -> S with Default::default() ``` -## testdata/tree/typecheck_fails +## testdata/typecheck_fails ``` src/lib.rs:5: replace try_value_coercion -> String with String::new() src/lib.rs:5: replace try_value_coercion -> String with "xyzzy".into() ``` -## testdata/tree/unapply +## testdata/unapply ``` src/a.rs:1: replace one -> i32 with 0 @@ -226,12 +226,12 @@ src/c.rs:1: replace one -> i32 with 1 src/c.rs:1: replace one -> i32 with -1 ``` -## testdata/tree/unsafe +## testdata/unsafe ``` ``` -## testdata/tree/well_tested +## testdata/well_tested ``` src/arc.rs:3: replace return_arc -> Arc with Arc::new(String::new()) @@ -274,7 +274,7 @@ src/struct_with_lifetime.rs:14: replace Lex<'buf>::buf_len -> usize with 0 src/struct_with_lifetime.rs:14: replace Lex<'buf>::buf_len -> usize with 1 ``` -## testdata/tree/with_child_directories +## testdata/with_child_directories ``` src/methods.rs:1: replace double -> usize with 0 @@ -293,7 +293,7 @@ src/module/utils/sub_utils/subutils_nested_function.rs:2: replace has_nested::in src/module/utils/sub_utils/subutils_nested_function.rs:2: replace has_nested::inner -> u32 with 1 ``` -## testdata/tree/workspace +## testdata/workspace ``` utils/src/lib.rs:1: replace triple -> i32 with 0 diff --git a/tests/cli/trace.rs b/tests/cli/trace.rs index 8ac69bb6..05d56815 100644 --- a/tests/cli/trace.rs +++ b/tests/cli/trace.rs @@ -12,7 +12,7 @@ fn env_var_controls_trace() { .env("CARGO_MUTANTS_TRACE_LEVEL", "trace") .args(["mutants", "--list"]) .arg("-d") - .arg("testdata/tree/never_type") + .arg("testdata/never_type") .assert() // This is a debug!() message; it should only be seen if the trace var // was wired correctly to stderr. diff --git a/tests/cli/windows.rs b/tests/cli/windows.rs index 7cda14db..26defb37 100644 --- a/tests/cli/windows.rs +++ b/tests/cli/windows.rs @@ -9,6 +9,6 @@ fn list_mutants_well_tested_exclude_folder_containing_backslash_on_windows() { run() .arg("mutants") .args(["--list", "--exclude", "*\\module\\*"]) - .current_dir("testdata/tree/with_child_directories") + .current_dir("testdata/with_child_directories") .assert_insta("list_mutants_well_tested_exclude_folder_filter"); } diff --git a/tests/cli/workspace.rs b/tests/cli/workspace.rs index 79b4e3d5..1fb12ea1 100644 --- a/tests/cli/workspace.rs +++ b/tests/cli/workspace.rs @@ -17,7 +17,7 @@ fn list_warns_about_unmatched_packages() { "mutants", "--list", "-d", - "testdata/tree/workspace", + "testdata/workspace", "-p", "notapackage", ]) @@ -33,7 +33,7 @@ fn list_files_json_workspace() { // Demonstrates that we get package names in the json listing. let cmd = run() .args(["mutants", "--list-files", "--json"]) - .current_dir("testdata/tree/workspace") + .current_dir("testdata/workspace") .assert() .success(); assert_bytes_eq_json( @@ -61,7 +61,7 @@ fn list_files_json_workspace() { fn list_files_as_json_in_workspace_subdir() { let cmd = run() .args(["mutants", "--list-files", "--json", "--workspace"]) - .current_dir("testdata/tree/workspace/main2") + .current_dir("testdata/workspace/main2") .assert() .success(); assert_bytes_eq_json(