diff --git a/Cargo.lock b/Cargo.lock index 1bee084083..283c27e120 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1823,7 +1823,6 @@ name = "jj-cli" version = "0.23.0" dependencies = [ "anyhow", - "assert_cmd", "assert_matches", "async-trait", "bstr", @@ -1846,7 +1845,6 @@ dependencies = [ "indoc", "insta", "itertools 0.13.0", - "jj-cli", "jj-lib", "libc", "maplit", @@ -1863,7 +1861,6 @@ dependencies = [ "slab", "strsim", "tempfile", - "test-case", "testutils", "textwrap", "thiserror", @@ -1875,6 +1872,27 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "jj-cli-tests" +version = "0.23.0" +dependencies = [ + "assert_cmd", + "chrono", + "clap", + "dunce", + "futures 0.3.31", + "git2", + "indoc", + "insta", + "itertools 0.13.0", + "jj-cli", + "jj-lib", + "regex", + "tempfile", + "test-case", + "testutils", +] + [[package]] name = "jj-lib" version = "0.23.0" @@ -1901,7 +1919,6 @@ dependencies = [ "hex", "ignore", "indexmap", - "indoc", "insta", "itertools 0.13.0", "jj-lib-proc-macros", @@ -1911,7 +1928,6 @@ dependencies = [ "pest", "pest_derive", "pollster", - "pretty_assertions", "prost", "rand", "rand_chacha", @@ -1926,7 +1942,6 @@ dependencies = [ "strsim", "tempfile", "test-case", - "testutils", "thiserror", "tokio", "tracing", @@ -1946,6 +1961,31 @@ dependencies = [ "syn", ] +[[package]] +name = "jj-lib-tests" +version = "0.23.0" +dependencies = [ + "assert_matches", + "chrono", + "config", + "futures 0.3.31", + "git2", + "gix", + "hex", + "indoc", + "insta", + "itertools 0.13.0", + "jj-lib", + "maplit", + "num_cpus", + "pollster", + "pretty_assertions", + "rand", + "tempfile", + "test-case", + "testutils", +] + [[package]] name = "jobserver" version = "0.1.32" diff --git a/Cargo.toml b/Cargo.toml index 15aa19b2e7..eae682875d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,15 @@ cargo-features = [] [workspace] resolver = "2" -members = ["cli", "lib", "lib/gen-protos", "lib/proc-macros", "lib/testutils"] +members = [ + "cli", + "cli/tests", + "lib", + "lib/gen-protos", + "lib/proc-macros", + "lib/tests", + "lib/testutils", +] [workspace.package] version = "0.23.0" @@ -130,6 +138,7 @@ zstd = "0.12.4" # put all inter-workspace libraries, i.e. those that use 'path = ...' here in # their own (alphabetically sorted) block +jj-cli = { path = "cli", version = "0.23.0" } jj-lib = { path = "lib", version = "0.23.0" } jj-lib-proc-macros = { path = "lib/proc-macros", version = "0.23.0" } testutils = { path = "lib/testutils" } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 96db2e855b..a36a50da1d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -19,8 +19,6 @@ include = [ "/examples/", "/src/", "/docs/**", - "/testing/", - "/tests/", "!*.pending-snap", "!*.snap*", "/tests/cli-reference@.md.snap" @@ -30,24 +28,6 @@ include = [ name = "jj" path = "src/main.rs" -[[bin]] -name = "fake-editor" -path = "testing/fake-editor.rs" -required-features = ["test-fakes"] - -[[bin]] -name = "fake-diff-editor" -path = "testing/fake-diff-editor.rs" -required-features = ["test-fakes"] - -[[bin]] -name = "fake-formatter" -path = "testing/fake-formatter.rs" -required-features = ["test-fakes"] - -[[test]] -name = "runner" - [dependencies] bstr = { workspace = true } chrono = { workspace = true } @@ -97,20 +77,15 @@ libc = { workspace = true } [dev-dependencies] anyhow = { workspace = true } -assert_cmd = { workspace = true } assert_matches = { workspace = true } async-trait = { workspace = true } insta = { workspace = true } -test-case = { workspace = true } testutils = { workspace = true } -# https://github.com/rust-lang/cargo/issues/2911#issuecomment-1483256987 -jj-cli = { path = ".", features = ["test-fakes"], default-features = false } [features] default = ["watchman"] bench = ["dep:criterion"] packaging = [] -test-fakes = ["jj-lib/testing"] vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"] watchman = ["jj-lib/watchman"] diff --git a/cli/tests/Cargo.toml b/cli/tests/Cargo.toml new file mode 100644 index 0000000000..b91d9c2aa6 --- /dev/null +++ b/cli/tests/Cargo.toml @@ -0,0 +1,60 @@ +[package] +name = "jj-cli-tests" +description = "Integration tests for the jj-cli crate" +autotests = false +publish = false + +version = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } +license = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +documentation = { workspace = true } +readme = { workspace = true } + +# FIXME: switch to custom main.rs and remove build.rs +build = "../build.rs" + +[[bin]] +name = "jj" +path = "../src/main.rs" + +# FIXME: move ../testing under .? +[[bin]] +name = "fake-diff-editor" +path = "../testing/fake-diff-editor.rs" + +[[bin]] +name = "fake-editor" +path = "../testing/fake-editor.rs" + +[[bin]] +name = "fake-formatter" +path = "../testing/fake-formatter.rs" + +[[test]] +name = "runner" +path = "runner.rs" + +[dependencies] +clap = { workspace = true } +itertools = { workspace = true } +jj-cli = { workspace = true } + +[dev-dependencies] +assert_cmd = { workspace = true } +chrono = { workspace = true } +dunce = { workspace = true } +futures = { workspace = true } +git2 = { workspace = true } +indoc = { workspace = true } +insta = { workspace = true } +jj-lib = { workspace = true, features = ["testing"] } +regex = { workspace = true } +tempfile = { workspace = true } +test-case = { workspace = true } +testutils = { workspace = true } + +[lints] +workspace = true diff --git a/cli/tests/runner.rs b/cli/tests/runner.rs index 39a1c77b0d..afac93dadd 100644 --- a/cli/tests/runner.rs +++ b/cli/tests/runner.rs @@ -1,11 +1,11 @@ -use std::path::PathBuf; +use std::path::Path; mod common; #[test] fn test_no_forgotten_test_files() { - let test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests"); - testutils::assert_no_forgotten_test_files(&test_dir); + let test_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + testutils::assert_no_forgotten_test_files(test_dir); } mod test_abandon_command; diff --git a/lib/Cargo.toml b/lib/Cargo.toml index b75e3bf49b..b3089c77cd 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -16,15 +16,11 @@ include = [ "/LICENSE", "/benches/", "/src/", - "/tests/", "!*.pending-snap", "!*.snap*", ] -[[test]] -name = "runner" - [[bench]] name = "diff_bench" harness = false @@ -88,12 +84,9 @@ winreg = { workspace = true } assert_matches = { workspace = true } criterion = { workspace = true } esl01-renderdag = { workspace = true } -indoc = { workspace = true } insta = { workspace = true } num_cpus = { workspace = true } -pretty_assertions = { workspace = true } test-case = { workspace = true } -testutils = { workspace = true } tokio = { workspace = true, features = ["full"] } [features] diff --git a/lib/src/default_index/mod.rs b/lib/src/default_index/mod.rs index 63d47960fe..3b8d738003 100644 --- a/lib/src/default_index/mod.rs +++ b/lib/src/default_index/mod.rs @@ -64,6 +64,7 @@ mod tests { use crate::object_id::HexPrefix; use crate::object_id::ObjectId; use crate::object_id::PrefixResolution; + use crate::tests::new_temp_dir; /// Generator of unique 16-byte CommitId excluding root id fn commit_id_generator() -> impl FnMut() -> CommitId { @@ -80,7 +81,7 @@ mod tests { #[test_case(false; "memory")] #[test_case(true; "file")] fn index_empty(on_disk: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mutable_segment = MutableIndexSegment::full(3, 16); let index_segment: Box = if on_disk { let saved_index = mutable_segment.save_in(temp_dir.path()).unwrap(); @@ -107,7 +108,7 @@ mod tests { #[test_case(false; "memory")] #[test_case(true; "file")] fn index_root_commit(on_disk: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_change_id = change_id_generator(); let mut mutable_segment = MutableIndexSegment::full(3, 16); let id_0 = CommitId::from_hex("000000"); @@ -159,7 +160,7 @@ mod tests { #[test_case(true, false; "incremental in memory")] #[test_case(true, true; "incremental on disk")] fn index_multiple_commits(incremental: bool, on_disk: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_change_id = change_id_generator(); let mut mutable_segment = MutableIndexSegment::full(3, 16); // 5 @@ -280,7 +281,7 @@ mod tests { #[test_case(false; "in memory")] #[test_case(true; "on disk")] fn index_many_parents(on_disk: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_change_id = change_id_generator(); let mut mutable_segment = MutableIndexSegment::full(3, 16); // 6 @@ -344,7 +345,7 @@ mod tests { #[test] fn resolve_commit_id_prefix() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_change_id = change_id_generator(); let mut mutable_segment = MutableIndexSegment::full(3, 16); @@ -416,7 +417,7 @@ mod tests { #[test] #[allow(clippy::redundant_clone)] // allow id_n.clone() fn neighbor_commit_ids() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_change_id = change_id_generator(); let mut mutable_segment = MutableIndexSegment::full(3, 16); @@ -544,7 +545,7 @@ mod tests { #[test] fn shortest_unique_commit_id_prefix() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_change_id = change_id_generator(); let mut mutable_segment = MutableIndexSegment::full(3, 16); @@ -598,7 +599,7 @@ mod tests { #[test] fn resolve_change_id_prefix() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_commit_id = commit_id_generator(); let local_positions_vec = |positions: &[u32]| -> SmallLocalPositionsVec { positions.iter().copied().map(LocalPosition).collect() @@ -768,7 +769,7 @@ mod tests { #[test] fn neighbor_change_ids() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_commit_id = commit_id_generator(); let id_0 = ChangeId::from_hex("00000001"); @@ -914,7 +915,7 @@ mod tests { #[test] fn shortest_unique_change_id_prefix() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let mut new_commit_id = commit_id_generator(); let id_0 = ChangeId::from_hex("00000001"); diff --git a/lib/src/file_util.rs b/lib/src/file_util.rs index 12c83afe9c..e1b9bff6bc 100644 --- a/lib/src/file_util.rs +++ b/lib/src/file_util.rs @@ -216,6 +216,7 @@ mod tests { use test_case::test_case; use super::*; + use crate::tests::new_temp_dir; #[test] fn normalize_too_many_dot_dot() { @@ -233,7 +234,7 @@ mod tests { #[test] fn test_persist_no_existing_file() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let target = temp_dir.path().join("file"); let mut temp_file = NamedTempFile::new_in(&temp_dir).unwrap(); temp_file.write_all(b"contents").unwrap(); @@ -243,7 +244,7 @@ mod tests { #[test_case(false ; "existing file open")] #[test_case(true ; "existing file closed")] fn test_persist_target_exists(existing_file_closed: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let target = temp_dir.path().join("file"); let mut temp_file = NamedTempFile::new_in(&temp_dir).unwrap(); temp_file.write_all(b"contents").unwrap(); diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs index 2d979d3671..175cbcce95 100644 --- a/lib/src/git_backend.rs +++ b/lib/src/git_backend.rs @@ -1541,12 +1541,13 @@ mod tests { use super::*; use crate::content_hash::blake2b_hash; + use crate::tests::new_temp_dir; #[test_case(false; "legacy tree format")] #[test_case(true; "tree-level conflict format")] fn read_plain_git_commit(uses_tree_conflict_format: bool) { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store_path = temp_dir.path(); let git_repo_path = temp_dir.path().join("git"); let git_repo = git2::Repository::init(git_repo_path).unwrap(); @@ -1708,7 +1709,7 @@ mod tests { #[test] fn read_git_commit_without_importing() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store_path = temp_dir.path(); let git_repo_path = temp_dir.path().join("git"); let git_repo = git2::Repository::init(git_repo_path).unwrap(); @@ -1748,7 +1749,7 @@ mod tests { #[test] fn read_signed_git_commit() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store_path = temp_dir.path(); let git_repo_path = temp_dir.path().join("git"); let git_repo = git2::Repository::init(git_repo_path).unwrap(); @@ -1840,7 +1841,7 @@ mod tests { #[test] fn git_commit_parents() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store_path = temp_dir.path(); let git_repo_path = temp_dir.path().join("git"); let git_repo = git2::Repository::init(git_repo_path).unwrap(); @@ -1909,7 +1910,7 @@ mod tests { #[test] fn write_tree_conflicts() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store_path = temp_dir.path(); let git_repo_path = temp_dir.path().join("git"); let git_repo = git2::Repository::init(git_repo_path).unwrap(); @@ -2010,7 +2011,7 @@ mod tests { #[test] fn commit_has_ref() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let backend = GitBackend::init_internal(&settings, temp_dir.path()).unwrap(); let git_repo = backend.open_git_repo().unwrap(); let signature = Signature { @@ -2060,7 +2061,7 @@ mod tests { #[test] fn import_head_commits_duplicates() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let backend = GitBackend::init_internal(&settings, temp_dir.path()).unwrap(); let git_repo = backend.open_git_repo().unwrap(); @@ -2096,7 +2097,7 @@ mod tests { #[test] fn overlapping_git_commit_id() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let backend = GitBackend::init_internal(&settings, temp_dir.path()).unwrap(); let mut commit1 = Commit { parents: vec![backend.root_commit_id().clone()], @@ -2141,7 +2142,7 @@ mod tests { #[test] fn write_signed_commit() { let settings = user_settings(); - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let backend = GitBackend::init_internal(&settings, temp_dir.path()).unwrap(); let commit = Commit { diff --git a/lib/src/lib.rs b/lib/src/lib.rs index d629ba88c1..037d6697cd 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -94,3 +94,17 @@ pub mod union_find; pub mod view; pub mod working_copy; pub mod workspace; + +#[cfg(test)] +mod tests { + use tempfile::TempDir; + + /// Unlike `testutils::new_temp_dir()`, this function doesn't set up + /// hermetic libgit2 environment. + pub fn new_temp_dir() -> TempDir { + tempfile::Builder::new() + .prefix("jj-test-") + .tempdir() + .unwrap() + } +} diff --git a/lib/src/local_backend.rs b/lib/src/local_backend.rs index 1d218130d2..a0990453ee 100644 --- a/lib/src/local_backend.rs +++ b/lib/src/local_backend.rs @@ -539,11 +539,12 @@ mod tests { use pollster::FutureExt; use super::*; + use crate::tests::new_temp_dir; /// Test that parents get written correctly #[test] fn write_commit_parents() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store_path = temp_dir.path(); let backend = LocalBackend::init(store_path); diff --git a/lib/src/lock.rs b/lib/src/lock.rs index 7bcb237ce1..22a3d54cb2 100644 --- a/lib/src/lock.rs +++ b/lib/src/lock.rs @@ -28,10 +28,11 @@ mod tests { use std::time::Duration; use super::*; + use crate::tests::new_temp_dir; #[test] fn lock_basic() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let lock_path = temp_dir.path().join("test.lock"); assert!(!lock_path.exists()); { @@ -43,7 +44,7 @@ mod tests { #[test] fn lock_concurrent() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let data_path = temp_dir.path().join("test"); let lock_path = temp_dir.path().join("test.lock"); fs::write(&data_path, 0_u32.to_le_bytes()).unwrap(); diff --git a/lib/src/repo_path.rs b/lib/src/repo_path.rs index 0a3e577703..2781406677 100644 --- a/lib/src/repo_path.rs +++ b/lib/src/repo_path.rs @@ -662,6 +662,7 @@ mod tests { use itertools::Itertools as _; use super::*; + use crate::tests::new_temp_dir; fn repo_path(value: &str) -> &RepoPath { RepoPath::from_internal_string(value) @@ -955,7 +956,7 @@ mod tests { #[test] fn parse_fs_path_wc_in_cwd() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let cwd_path = temp_dir.path().join("repo"); let wc_path = &cwd_path; @@ -1014,7 +1015,7 @@ mod tests { #[test] fn parse_fs_path_wc_in_cwd_parent() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let cwd_path = temp_dir.path().join("dir"); let wc_path = cwd_path.parent().unwrap().to_path_buf(); @@ -1053,7 +1054,7 @@ mod tests { #[test] fn parse_fs_path_wc_in_cwd_child() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let cwd_path = temp_dir.path().join("cwd"); let wc_path = cwd_path.join("repo"); diff --git a/lib/src/simple_op_store.rs b/lib/src/simple_op_store.rs index a1ecbde943..3784fa2000 100644 --- a/lib/src/simple_op_store.rs +++ b/lib/src/simple_op_store.rs @@ -723,6 +723,7 @@ mod tests { use maplit::hashset; use super::*; + use crate::tests::new_temp_dir; fn create_view() -> View { let new_remote_ref = |target: &RefTarget| RemoteRef { @@ -822,7 +823,7 @@ mod tests { #[test] fn test_read_write_view() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let root_data = RootOperationData { root_commit_id: CommitId::from_hex("000000"), }; @@ -835,7 +836,7 @@ mod tests { #[test] fn test_read_write_operation() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let root_data = RootOperationData { root_commit_id: CommitId::from_hex("000000"), }; diff --git a/lib/src/stacked_table.rs b/lib/src/stacked_table.rs index b7d140c1a2..686b19b830 100644 --- a/lib/src/stacked_table.rs +++ b/lib/src/stacked_table.rs @@ -518,11 +518,12 @@ mod tests { use test_case::test_case; use super::*; + use crate::tests::new_temp_dir; #[test_case(false; "memory")] #[test_case(true; "file")] fn stacked_table_empty(on_disk: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store = TableStore::init(temp_dir.path().to_path_buf(), 3); let mut_table = store.get_head().unwrap().start_mutation(); let mut _saved_table = None; @@ -542,7 +543,7 @@ mod tests { #[test_case(false; "memory")] #[test_case(true; "file")] fn stacked_table_single_key(on_disk: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store = TableStore::init(temp_dir.path().to_path_buf(), 3); let mut mut_table = store.get_head().unwrap().start_mutation(); mut_table.add_entry(b"abc".to_vec(), b"value".to_vec()); @@ -563,7 +564,7 @@ mod tests { #[test_case(false; "memory")] #[test_case(true; "file")] fn stacked_table_multiple_keys(on_disk: bool) { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store = TableStore::init(temp_dir.path().to_path_buf(), 3); let mut mut_table = store.get_head().unwrap().start_mutation(); mut_table.add_entry(b"zzz".to_vec(), b"val3".to_vec()); @@ -589,7 +590,7 @@ mod tests { #[test] fn stacked_table_multiple_keys_with_parent_file() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store = TableStore::init(temp_dir.path().to_path_buf(), 3); let mut mut_table = store.get_head().unwrap().start_mutation(); mut_table.add_entry(b"abd".to_vec(), b"value 2".to_vec()); @@ -619,7 +620,7 @@ mod tests { #[test] fn stacked_table_merge() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store = TableStore::init(temp_dir.path().to_path_buf(), 3); let mut mut_base_table = store.get_head().unwrap().start_mutation(); mut_base_table.add_entry(b"abc".to_vec(), b"value1".to_vec()); @@ -652,7 +653,7 @@ mod tests { #[test] fn stacked_table_automatic_merge() { // Same test as above, but here we let the store do the merging on load - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store = TableStore::init(temp_dir.path().to_path_buf(), 3); let mut mut_base_table = store.get_head().unwrap().start_mutation(); mut_base_table.add_entry(b"abc".to_vec(), b"value1".to_vec()); @@ -689,7 +690,7 @@ mod tests { #[test] fn stacked_table_store_save_empty() { - let temp_dir = testutils::new_temp_dir(); + let temp_dir = new_temp_dir(); let store = TableStore::init(temp_dir.path().to_path_buf(), 3); let mut mut_table = store.get_head().unwrap().start_mutation(); diff --git a/lib/tests/Cargo.toml b/lib/tests/Cargo.toml new file mode 100644 index 0000000000..eced21c3f0 --- /dev/null +++ b/lib/tests/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "jj-lib-tests" +description = "Integration tests for the jj-lib crate" +autotests = false +publish = false + +version = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } +license = { workspace = true } +homepage = { workspace = true } +repository = { workspace = true } +documentation = { workspace = true } +readme = { workspace = true } + +[[test]] +name = "runner" +path = "runner.rs" + +[dev-dependencies] +assert_matches = { workspace = true } +chrono = { workspace = true } +config = { workspace = true } +futures = { workspace = true } +git2 = { workspace = true } +gix = { workspace = true } +hex = { workspace = true } +indoc = { workspace = true } +insta = { workspace = true } +itertools = { workspace = true } +jj-lib = { workspace = true, features = ["testing"] } +maplit = { workspace = true } +num_cpus = { workspace = true } +pollster = { workspace = true } +pretty_assertions = { workspace = true } +rand = { workspace = true } +tempfile = { workspace = true } +test-case = { workspace = true } +testutils = { workspace = true } + +[lints] +workspace = true diff --git a/lib/tests/runner.rs b/lib/tests/runner.rs index f56376142a..a3e39813d3 100644 --- a/lib/tests/runner.rs +++ b/lib/tests/runner.rs @@ -1,9 +1,9 @@ -use std::path::PathBuf; +use std::path::Path; #[test] fn test_no_forgotten_test_files() { - let test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests"); - testutils::assert_no_forgotten_test_files(&test_dir); + let test_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + testutils::assert_no_forgotten_test_files(test_dir); } mod test_annotate;