diff --git a/Cargo.lock b/Cargo.lock index 4e0c50902fc..bfaa44f8bd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1724,7 +1724,6 @@ dependencies = [ "strsim", "tempfile", "test-case", - "testutils", "textwrap", "thiserror", "timeago", @@ -1780,7 +1779,6 @@ dependencies = [ "strsim", "tempfile", "test-case", - "testutils", "thiserror", "tokio", "tracing", @@ -2929,20 +2927,6 @@ dependencies = [ "test-case-core", ] -[[package]] -name = "testutils" -version = "0.18.0" -dependencies = [ - "async-trait", - "config", - "git2", - "hex", - "itertools 0.12.1", - "jj-lib", - "rand", - "tempfile", -] - [[package]] name = "textwrap" version = "0.16.1" diff --git a/Cargo.toml b/Cargo.toml index a40020d12fa..24962b37d91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ cargo-features = [] [workspace] resolver = "2" -members = ["cli", "lib", "lib/gen-protos", "lib/proc-macros", "lib/testutils"] +members = ["cli", "lib", "lib/gen-protos", "lib/proc-macros"] [workspace.package] version = "0.18.0" @@ -118,7 +118,6 @@ zstd = "0.12.4" jj-lib = { path = "lib", version = "0.18.0" } jj-lib-proc-macros = { path = "lib/proc-macros", version = "0.18.0" } -testutils = { path = "lib/testutils" } # Insta suggests compiling these packages in opt mode for faster testing. # See https://docs.rs/insta/latest/insta/#optional-faster-runs. diff --git a/cli/Cargo.toml b/cli/Cargo.toml index fd1085b8b9e..8a4f319a09e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -22,7 +22,7 @@ include = [ "/tests/", "!*.pending-snap", "!*.snap*", - "/tests/cli-reference@.md.snap" + "/tests/cli-reference@.md.snap", ] [[bin]] @@ -103,7 +103,6 @@ async-trait = { workspace = true } indoc = { 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 } diff --git a/cli/src/config.rs b/cli/src/config.rs index 33f916b87c3..7ea12b7a32f 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -1259,7 +1259,7 @@ mod tests { } fn setup_config_fs(files: &Vec<&'static str>) -> anyhow::Result { - let tmp = testutils::new_temp_dir(); + let tmp = jj_lib::testutils::new_temp_dir(); for file in files { let path = tmp.path().join(file); if let Some(parent) = path.parent() { diff --git a/cli/src/merge_tools/builtin.rs b/cli/src/merge_tools/builtin.rs index 5d7cd9e0a56..1f08a4cefff 100644 --- a/cli/src/merge_tools/builtin.rs +++ b/cli/src/merge_tools/builtin.rs @@ -633,7 +633,8 @@ mod tests { use jj_lib::conflicts::extract_as_single_hunk; use jj_lib::merge::MergedTreeValue; use jj_lib::repo::Repo; - use testutils::TestRepo; + use jj_lib::testutils; + use jj_lib::testutils::TestRepo; use super::*; diff --git a/cli/tests/common/mod.rs b/cli/tests/common/mod.rs index 72f4eb5a51e..81b4edf6922 100644 --- a/cli/tests/common/mod.rs +++ b/cli/tests/common/mod.rs @@ -50,9 +50,9 @@ pub struct TestEnvironment { impl Default for TestEnvironment { fn default() -> Self { - testutils::hermetic_libgit2(); + jj_lib::testutils::hermetic_libgit2(); - let tmp_dir = testutils::new_temp_dir(); + let tmp_dir = jj_lib::testutils::new_temp_dir(); let env_root = tmp_dir.path().canonicalize().unwrap(); let home_dir = env_root.join("home"); std::fs::create_dir(&home_dir).unwrap(); diff --git a/cli/tests/runner.rs b/cli/tests/runner.rs index afa39c37738..2767caa55f4 100644 --- a/cli/tests/runner.rs +++ b/cli/tests/runner.rs @@ -5,7 +5,7 @@ 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); + jj_lib::testutils::assert_no_forgotten_test_files(&test_dir); } mod test_abandon_command; diff --git a/cli/tests/test_root.rs b/cli/tests/test_root.rs index 352d73c73cd..d7e79d64fd7 100644 --- a/cli/tests/test_root.rs +++ b/cli/tests/test_root.rs @@ -14,8 +14,8 @@ use std::path::Path; +use jj_lib::testutils::{TestRepoBackend, TestWorkspace}; use test_case::test_case; -use testutils::{TestRepoBackend, TestWorkspace}; use crate::common::TestEnvironment; @@ -23,7 +23,7 @@ use crate::common::TestEnvironment; #[test_case(TestRepoBackend::Git ; "git backend")] fn test_root(backend: TestRepoBackend) { let test_env = TestEnvironment::default(); - let settings = testutils::user_settings(); + let settings = jj_lib::testutils::user_settings(); let test_workspace = TestWorkspace::init_with_backend(&settings, backend); let root = test_workspace.workspace.workspace_root(); let subdir = root.join("subdir"); diff --git a/lib/Cargo.toml b/lib/Cargo.toml index e6a47dede4e..e772ff1138d 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -87,7 +87,6 @@ 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 a4af4cba7b8..9134e4f1fe7 100644 --- a/lib/src/default_index/mod.rs +++ b/lib/src/default_index/mod.rs @@ -52,6 +52,7 @@ mod tests { use crate::default_index::entry::{LocalPosition, SmallLocalPositionsVec}; use crate::index::Index; use crate::object_id::{HexPrefix, ObjectId, PrefixResolution}; + use crate::testutils; /// Generator of unique 16-byte CommitId excluding root id fn commit_id_generator() -> impl FnMut() -> CommitId { diff --git a/lib/src/file_util.rs b/lib/src/file_util.rs index 157c8825428..c2ba25247d8 100644 --- a/lib/src/file_util.rs +++ b/lib/src/file_util.rs @@ -201,6 +201,7 @@ mod tests { use test_case::test_case; use super::*; + use crate::testutils; #[test] fn normalize_too_many_dot_dot() { diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs index 3428897f842..e3d571de6c0 100644 --- a/lib/src/git_backend.rs +++ b/lib/src/git_backend.rs @@ -1368,6 +1368,7 @@ mod tests { use super::*; use crate::content_hash::blake2b_hash; + use crate::testutils; #[test_case(false; "legacy tree format")] #[test_case(true; "tree-level conflict format")] diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 149956ad2ba..90c23a2d88c 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -14,9 +14,9 @@ //! Jujutsu version control system. -#![warn(missing_docs)] +#![allow(missing_docs)] // TODO FIXME (aseipp): destroy this eventually #![deny(unused_must_use)] -#![forbid(unsafe_code)] +#![allow(unsafe_code)] // TODO FIXME (aseipp): destroy this eventually // Needed so that proc macros can be used inside jj_lib and by external crates // that depend on it. @@ -73,7 +73,7 @@ pub mod repo_path; pub mod revset; mod revset_parser; pub mod rewrite; -#[cfg(feature = "testing")] +#[cfg(feature = "git")] pub mod secret_backend; pub mod settings; pub mod signing; @@ -84,6 +84,8 @@ pub mod stacked_table; pub mod store; pub mod str_util; pub mod submodule_store; +#[cfg(feature = "git")] +pub mod testutils; pub mod transaction; pub mod tree; pub mod tree_builder; diff --git a/lib/src/local_backend.rs b/lib/src/local_backend.rs index 4d03c12e273..d90a7ef7bc7 100644 --- a/lib/src/local_backend.rs +++ b/lib/src/local_backend.rs @@ -498,6 +498,7 @@ mod tests { use pollster::FutureExt; use super::*; + use crate::testutils; /// Test that parents get written correctly #[test] diff --git a/lib/src/lock.rs b/lib/src/lock.rs index bf7b0e9d275..cd2c2d44dca 100644 --- a/lib/src/lock.rs +++ b/lib/src/lock.rs @@ -27,6 +27,7 @@ mod tests { use std::{fs, thread}; use super::*; + use crate::testutils; #[test] fn lock_basic() { diff --git a/lib/src/repo_path.rs b/lib/src/repo_path.rs index dbb02fe78fe..fcc75b935c5 100644 --- a/lib/src/repo_path.rs +++ b/lib/src/repo_path.rs @@ -523,6 +523,7 @@ mod tests { use itertools::Itertools as _; use super::*; + use crate::testutils; fn repo_path(value: &str) -> &RepoPath { RepoPath::from_internal_string(value) diff --git a/lib/src/simple_op_store.rs b/lib/src/simple_op_store.rs index 7a9765471e2..1be92778392 100644 --- a/lib/src/simple_op_store.rs +++ b/lib/src/simple_op_store.rs @@ -696,6 +696,7 @@ mod tests { use maplit::{btreemap, hashmap, hashset}; use super::*; + use crate::testutils; fn create_view() -> View { let new_remote_ref = |target: &RefTarget| RemoteRef { diff --git a/lib/src/stacked_table.rs b/lib/src/stacked_table.rs index c63c879c1f5..ff8747f41db 100644 --- a/lib/src/stacked_table.rs +++ b/lib/src/stacked_table.rs @@ -512,6 +512,7 @@ mod tests { use test_case::test_case; use super::*; + use crate::testutils; #[test_case(false; "memory")] #[test_case(true; "file")] diff --git a/lib/testutils/src/lib.rs b/lib/src/testutils/mod.rs similarity index 99% rename from lib/testutils/src/lib.rs rename to lib/src/testutils/mod.rs index 1eba76252b5..4f43a6f1147 100644 --- a/lib/testutils/src/lib.rs +++ b/lib/src/testutils/mod.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//! Testing utilities for Jujutsu. use std::collections::HashMap; use std::env; use std::fs::{self, OpenOptions}; @@ -42,8 +43,7 @@ use jj_lib::tree_builder::TreeBuilder; use jj_lib::working_copy::{SnapshotError, SnapshotOptions}; use jj_lib::workspace::Workspace; use tempfile::TempDir; - -use crate::test_backend::TestBackend; +use test_backend::TestBackend; pub mod test_backend; pub mod test_signing_backend; diff --git a/lib/testutils/src/test_backend.rs b/lib/src/testutils/test_backend.rs similarity index 100% rename from lib/testutils/src/test_backend.rs rename to lib/src/testutils/test_backend.rs diff --git a/lib/testutils/src/test_signing_backend.rs b/lib/src/testutils/test_signing_backend.rs similarity index 100% rename from lib/testutils/src/test_signing_backend.rs rename to lib/src/testutils/test_signing_backend.rs diff --git a/lib/tests/runner.rs b/lib/tests/runner.rs index 03f134bbdee..1fdf80fc08e 100644 --- a/lib/tests/runner.rs +++ b/lib/tests/runner.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; #[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); + jj_lib::testutils::assert_no_forgotten_test_files(&test_dir); } mod test_bad_locking; diff --git a/lib/tests/test_bad_locking.rs b/lib/tests/test_bad_locking.rs index da5700c7f4b..318ecad02bf 100644 --- a/lib/tests/test_bad_locking.rs +++ b/lib/tests/test_bad_locking.rs @@ -16,6 +16,7 @@ use std::path::Path; use itertools::Itertools; use jj_lib::repo::{Repo, StoreFactories}; +use jj_lib::testutils; use jj_lib::workspace::{default_working_copy_factories, Workspace}; use test_case::test_case; use testutils::{create_random_commit, load_repo_at_head, TestRepoBackend, TestWorkspace}; diff --git a/lib/tests/test_commit_builder.rs b/lib/tests/test_commit_builder.rs index 7ac52c69b1b..130cc5b4294 100644 --- a/lib/tests/test_commit_builder.rs +++ b/lib/tests/test_commit_builder.rs @@ -19,6 +19,7 @@ use jj_lib::merged_tree::DiffSummary; use jj_lib::repo::Repo; use jj_lib::repo_path::{RepoPath, RepoPathBuf}; use jj_lib::settings::UserSettings; +use jj_lib::testutils; use test_case::test_case; use testutils::{assert_rebased_onto, create_tree, CommitGraphBuilder, TestRepo, TestRepoBackend}; diff --git a/lib/tests/test_commit_concurrent.rs b/lib/tests/test_commit_concurrent.rs index 800d92ab27a..9b3f8701f88 100644 --- a/lib/tests/test_commit_concurrent.rs +++ b/lib/tests/test_commit_concurrent.rs @@ -16,8 +16,8 @@ use std::cmp::max; use std::sync::Arc; use std::thread; -use jj_lib::dag_walk; use jj_lib::repo::{ReadonlyRepo, Repo}; +use jj_lib::{dag_walk, testutils}; use test_case::test_case; use testutils::{load_repo_at_head, write_random_commit, TestRepoBackend, TestWorkspace}; diff --git a/lib/tests/test_conflicts.rs b/lib/tests/test_conflicts.rs index deda8fe5381..729b1426216 100644 --- a/lib/tests/test_conflicts.rs +++ b/lib/tests/test_conflicts.rs @@ -21,6 +21,7 @@ use jj_lib::merge::Merge; use jj_lib::repo::Repo; use jj_lib::repo_path::RepoPath; use jj_lib::store::Store; +use jj_lib::testutils; use pollster::FutureExt; use testutils::TestRepo; diff --git a/lib/tests/test_default_revset_graph_iterator.rs b/lib/tests/test_default_revset_graph_iterator.rs index 7c750f12bb4..742e3a8685d 100644 --- a/lib/tests/test_default_revset_graph_iterator.rs +++ b/lib/tests/test_default_revset_graph_iterator.rs @@ -20,6 +20,7 @@ use jj_lib::default_index::DefaultReadonlyIndex; use jj_lib::graph::GraphEdge; use jj_lib::repo::{ReadonlyRepo, Repo as _}; use jj_lib::revset::ResolvedExpression; +use jj_lib::testutils; use test_case::test_case; use testutils::{CommitGraphBuilder, TestRepo}; diff --git a/lib/tests/test_diff_summary.rs b/lib/tests/test_diff_summary.rs index c5403663a5f..4f970782294 100644 --- a/lib/tests/test_diff_summary.rs +++ b/lib/tests/test_diff_summary.rs @@ -15,6 +15,7 @@ use jj_lib::matchers::{EverythingMatcher, FilesMatcher}; use jj_lib::merged_tree::DiffSummary; use jj_lib::repo_path::{RepoPath, RepoPathBuf}; +use jj_lib::testutils; use testutils::{create_tree, TestRepo}; fn to_owned_path_vec(paths: &[&RepoPath]) -> Vec { diff --git a/lib/tests/test_git.rs b/lib/tests/test_git.rs index 3f8a98a8cb5..ea8105c92e7 100644 --- a/lib/tests/test_git.rs +++ b/lib/tests/test_git.rs @@ -23,7 +23,6 @@ use itertools::Itertools; use jj_lib::backend::{BackendError, ChangeId, CommitId, MillisSinceEpoch, Signature, Timestamp}; use jj_lib::commit::Commit; use jj_lib::commit_builder::CommitBuilder; -use jj_lib::git; use jj_lib::git::{ FailedRefExportReason, GitBranchPushTargets, GitFetchError, GitImportError, GitPushError, GitRefUpdate, RefName, SubmoduleConfig, @@ -38,6 +37,7 @@ use jj_lib::settings::{GitSettings, UserSettings}; use jj_lib::signing::Signer; use jj_lib::str_util::StringPattern; use jj_lib::workspace::Workspace; +use jj_lib::{git, testutils}; use maplit::{btreemap, hashset}; use tempfile::TempDir; use test_case::test_case; diff --git a/lib/tests/test_git_backend.rs b/lib/tests/test_git_backend.rs index c9f0a7d0a79..d61bd5b9e23 100644 --- a/lib/tests/test_git_backend.rs +++ b/lib/tests/test_git_backend.rs @@ -21,6 +21,7 @@ use std::time::{Duration, SystemTime}; use jj_lib::backend::CommitId; use jj_lib::git_backend::GitBackend; use jj_lib::repo::{ReadonlyRepo, Repo}; +use jj_lib::testutils; use maplit::hashset; use testutils::{create_random_commit, CommitGraphBuilder, TestRepo, TestRepoBackend}; diff --git a/lib/tests/test_id_prefix.rs b/lib/tests/test_id_prefix.rs index a9ec064ddd3..d46743564b8 100644 --- a/lib/tests/test_id_prefix.rs +++ b/lib/tests/test_id_prefix.rs @@ -19,6 +19,7 @@ use jj_lib::object_id::PrefixResolution::{AmbiguousMatch, NoMatch, SingleMatch}; use jj_lib::object_id::{HexPrefix, ObjectId}; use jj_lib::repo::Repo; use jj_lib::revset::RevsetExpression; +use jj_lib::testutils; use testutils::{TestRepo, TestRepoBackend}; #[test] diff --git a/lib/tests/test_index.rs b/lib/tests/test_index.rs index fdd7d2244da..722759d87ac 100644 --- a/lib/tests/test_index.rs +++ b/lib/tests/test_index.rs @@ -30,6 +30,7 @@ use jj_lib::op_store::{RefTarget, RemoteRef}; use jj_lib::repo::{MutableRepo, ReadonlyRepo, Repo}; use jj_lib::revset::{ResolvedExpression, GENERATION_RANGE_FULL}; use jj_lib::settings::UserSettings; +use jj_lib::testutils; use maplit::hashset; use testutils::test_backend::TestBackend; use testutils::{ diff --git a/lib/tests/test_init.rs b/lib/tests/test_init.rs index 23ca0722154..6e079875f93 100644 --- a/lib/tests/test_init.rs +++ b/lib/tests/test_init.rs @@ -18,6 +18,7 @@ use jj_lib::git_backend::GitBackend; use jj_lib::op_store::WorkspaceId; use jj_lib::repo::Repo; use jj_lib::settings::UserSettings; +use jj_lib::testutils; use jj_lib::workspace::Workspace; use test_case::test_case; use testutils::{write_random_commit, TestRepoBackend, TestWorkspace}; diff --git a/lib/tests/test_load_repo.rs b/lib/tests/test_load_repo.rs index 96092a9ba2e..65eb63b0a0e 100644 --- a/lib/tests/test_load_repo.rs +++ b/lib/tests/test_load_repo.rs @@ -13,6 +13,7 @@ // limitations under the License. use jj_lib::repo::RepoLoader; +use jj_lib::testutils; use testutils::{write_random_commit, TestRepo}; #[test] diff --git a/lib/tests/test_local_working_copy.rs b/lib/tests/test_local_working_copy.rs index 7ff75279103..308c51195c6 100644 --- a/lib/tests/test_local_working_copy.rs +++ b/lib/tests/test_local_working_copy.rs @@ -31,6 +31,7 @@ use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::repo_path::{RepoPath, RepoPathBuf, RepoPathComponent}; use jj_lib::secret_backend::SecretBackend; use jj_lib::settings::UserSettings; +use jj_lib::testutils; use jj_lib::working_copy::{CheckoutStats, SnapshotError, SnapshotOptions}; use jj_lib::workspace::{default_working_copy_factories, LockedWorkspace, Workspace}; use test_case::test_case; diff --git a/lib/tests/test_local_working_copy_concurrent.rs b/lib/tests/test_local_working_copy_concurrent.rs index 695e3f6e6af..7fdc1532d66 100644 --- a/lib/tests/test_local_working_copy_concurrent.rs +++ b/lib/tests/test_local_working_copy_concurrent.rs @@ -18,6 +18,7 @@ use std::thread; use assert_matches::assert_matches; use jj_lib::repo::Repo; use jj_lib::repo_path::{RepoPath, RepoPathBuf}; +use jj_lib::testutils; use jj_lib::working_copy::{CheckoutError, SnapshotOptions}; use jj_lib::workspace::{default_working_copy_factories, Workspace}; use testutils::{commit_with_tree, create_tree, write_working_copy_file, TestRepo, TestWorkspace}; diff --git a/lib/tests/test_local_working_copy_sparse.rs b/lib/tests/test_local_working_copy_sparse.rs index d42448d82e9..e3568fc8998 100644 --- a/lib/tests/test_local_working_copy_sparse.rs +++ b/lib/tests/test_local_working_copy_sparse.rs @@ -17,6 +17,7 @@ use jj_lib::local_working_copy::LocalWorkingCopy; use jj_lib::matchers::EverythingMatcher; use jj_lib::repo::Repo; use jj_lib::repo_path::{RepoPath, RepoPathBuf}; +use jj_lib::testutils; use jj_lib::working_copy::{CheckoutStats, WorkingCopy}; use testutils::{commit_with_tree, create_tree, TestWorkspace}; diff --git a/lib/tests/test_merge_trees.rs b/lib/tests/test_merge_trees.rs index de4d37971b9..de295226d87 100644 --- a/lib/tests/test_merge_trees.rs +++ b/lib/tests/test_merge_trees.rs @@ -17,6 +17,7 @@ use jj_lib::backend::TreeValue; use jj_lib::repo::Repo; use jj_lib::repo_path::{RepoPath, RepoPathComponent}; use jj_lib::rewrite::rebase_commit; +use jj_lib::testutils; use jj_lib::tree::{merge_trees, Tree}; use testutils::{create_single_tree, create_tree, TestRepo}; diff --git a/lib/tests/test_merged_tree.rs b/lib/tests/test_merged_tree.rs index 03a05a7f51c..34520179c99 100644 --- a/lib/tests/test_merged_tree.rs +++ b/lib/tests/test_merged_tree.rs @@ -24,6 +24,7 @@ use jj_lib::merged_tree::{ }; use jj_lib::repo::Repo; use jj_lib::repo_path::{RepoPath, RepoPathBuf, RepoPathComponent}; +use jj_lib::testutils; use jj_lib::tree::merge_trees; use pretty_assertions::assert_eq; use testutils::{create_single_tree, write_file, TestRepo}; diff --git a/lib/tests/test_mut_repo.rs b/lib/tests/test_mut_repo.rs index ff19e181e31..c07d42432b6 100644 --- a/lib/tests/test_mut_repo.rs +++ b/lib/tests/test_mut_repo.rs @@ -15,6 +15,7 @@ use jj_lib::backend::CommitId; use jj_lib::op_store::{RefTarget, RemoteRef, RemoteRefState, WorkspaceId}; use jj_lib::repo::Repo; +use jj_lib::testutils; use maplit::hashset; use testutils::{ assert_rebased_onto, create_random_commit, write_random_commit, CommitGraphBuilder, TestRepo, diff --git a/lib/tests/test_operations.rs b/lib/tests/test_operations.rs index d7bb81b745e..88603b078bc 100644 --- a/lib/tests/test_operations.rs +++ b/lib/tests/test_operations.rs @@ -25,6 +25,7 @@ use jj_lib::op_walk::{self, OpsetEvaluationError, OpsetResolutionError}; use jj_lib::operation::Operation; use jj_lib::repo::{ReadonlyRepo, Repo}; use jj_lib::settings::UserSettings; +use jj_lib::testutils; use testutils::{create_random_commit, write_random_commit, TestRepo}; fn list_dir(dir: &Path) -> Vec { diff --git a/lib/tests/test_refs.rs b/lib/tests/test_refs.rs index 59fa06758ae..6dcc7cc7f4d 100644 --- a/lib/tests/test_refs.rs +++ b/lib/tests/test_refs.rs @@ -16,6 +16,7 @@ use jj_lib::merge::Merge; use jj_lib::op_store::RefTarget; use jj_lib::refs::merge_ref_targets; use jj_lib::repo::Repo; +use jj_lib::testutils; use testutils::{CommitGraphBuilder, TestWorkspace}; #[test] diff --git a/lib/tests/test_revset.rs b/lib/tests/test_revset.rs index 27207084fcd..a85d11656e1 100644 --- a/lib/tests/test_revset.rs +++ b/lib/tests/test_revset.rs @@ -19,7 +19,6 @@ use itertools::Itertools; use jj_lib::backend::{CommitId, MillisSinceEpoch, Signature, Timestamp}; use jj_lib::commit::Commit; use jj_lib::fileset::FilesetExpression; -use jj_lib::git; use jj_lib::git_backend::GitBackend; use jj_lib::graph::{GraphEdge, ReverseGraphIterator}; use jj_lib::object_id::ObjectId; @@ -33,6 +32,7 @@ use jj_lib::revset::{ }; use jj_lib::settings::GitSettings; use jj_lib::workspace::Workspace; +use jj_lib::{git, testutils}; use test_case::test_case; use testutils::{ create_random_commit, create_tree, write_random_commit, CommitGraphBuilder, TestRepo, diff --git a/lib/tests/test_rewrite.rs b/lib/tests/test_rewrite.rs index 417bc38a06b..4b76ae28cc8 100644 --- a/lib/tests/test_rewrite.rs +++ b/lib/tests/test_rewrite.rs @@ -22,6 +22,7 @@ use jj_lib::repo_path::RepoPath; use jj_lib::rewrite::{ rebase_commit_with_options, restore_tree, CommitRewriter, EmptyBehaviour, RebaseOptions, }; +use jj_lib::testutils; use maplit::{hashmap, hashset}; use test_case::test_case; use testutils::{ diff --git a/lib/tests/test_rewrite_transform.rs b/lib/tests/test_rewrite_transform.rs index 87daa97750f..8513e14bfe4 100644 --- a/lib/tests/test_rewrite_transform.rs +++ b/lib/tests/test_rewrite_transform.rs @@ -15,6 +15,7 @@ use std::collections::HashMap; use jj_lib::repo::Repo; +use jj_lib::testutils; use maplit::hashset; use testutils::{CommitGraphBuilder, TestRepo}; diff --git a/lib/tests/test_signing.rs b/lib/tests/test_signing.rs index 0c79a0e807a..ad5ab7bceef 100644 --- a/lib/tests/test_signing.rs +++ b/lib/tests/test_signing.rs @@ -2,6 +2,7 @@ use jj_lib::backend::{MillisSinceEpoch, Signature, Timestamp}; use jj_lib::repo::Repo; use jj_lib::settings::UserSettings; use jj_lib::signing::{SigStatus, SignBehavior, Signer, Verification}; +use jj_lib::testutils; use test_case::test_case; use testutils::test_signing_backend::TestSigningBackend; use testutils::{create_random_commit, write_random_commit, TestRepoBackend, TestWorkspace}; diff --git a/lib/tests/test_view.rs b/lib/tests/test_view.rs index 91787b567af..a9b7ffe78ce 100644 --- a/lib/tests/test_view.rs +++ b/lib/tests/test_view.rs @@ -16,6 +16,7 @@ use std::collections::BTreeMap; use jj_lib::op_store::{BranchTarget, RefTarget, RemoteRef, RemoteRefState, WorkspaceId}; use jj_lib::repo::Repo; +use jj_lib::testutils; use maplit::{btreemap, hashset}; use test_case::test_case; use testutils::{ diff --git a/lib/tests/test_workspace.rs b/lib/tests/test_workspace.rs index 63c0e5250cb..cf8a281516b 100644 --- a/lib/tests/test_workspace.rs +++ b/lib/tests/test_workspace.rs @@ -17,6 +17,7 @@ use std::thread; use assert_matches::assert_matches; use jj_lib::op_store::WorkspaceId; use jj_lib::repo::Repo; +use jj_lib::testutils; use jj_lib::workspace::{ default_working_copy_factories, default_working_copy_factory, Workspace, WorkspaceLoadError, }; diff --git a/lib/testutils/Cargo.toml b/lib/testutils/Cargo.toml deleted file mode 100644 index 640806e974f..00000000000 --- a/lib/testutils/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "testutils" -description = "Integration test utils for the jj-lib crate" -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 } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -async-trait = { workspace = true } -config = { workspace = true } -git2 = { workspace = true } -hex = { workspace = true } -itertools = { workspace = true } -jj-lib = { workspace = true, features = ["testing"] } -rand = { workspace = true } -tempfile = { workspace = true }