Browse Source

prepare test utilities for release…

…otherwise publishing won't work.
pull/80/head git-odb-v0.12.0
Sebastian Thiel 2 months ago
parent
commit
d35e654747
No known key found for this signature in database GPG Key ID: 9CB5EE7895E8268B
  1. 26
      Cargo.lock
  2. 2
      git-commitgraph/Cargo.toml
  3. 2
      git-commitgraph/tests/commitgraph.rs
  4. 2
      git-diff/Cargo.toml
  5. 2
      git-diff/tests/visit/mod.rs
  6. 2
      git-odb/Cargo.toml
  7. 6
      git-odb/tests/odb/alternate/mod.rs
  8. 4
      git-odb/tests/odb/linked/mod.rs
  9. 2
      git-odb/tests/odb/mod.rs
  10. 6
      tests/tools/Cargo.toml

26
Cargo.lock

@ -729,8 +729,8 @@ dependencies = [
"filebuffer",
"git-features",
"git-hash",
"git-testtools",
"serde",
"test-tools",
"thiserror",
]
@ -752,8 +752,8 @@ dependencies = [
"git-hash",
"git-object",
"git-odb",
"git-testtools",
"quick-error",
"test-tools",
]
[[package]]
@ -819,6 +819,7 @@ dependencies = [
"git-features",
"git-hash",
"git-object",
"git-testtools",
"hex",
"itoa",
"memory-lru",
@ -827,7 +828,6 @@ dependencies = [
"serde",
"smallvec",
"tempfile",
"test-tools",
"thiserror",
"uluru",
]
@ -873,6 +873,16 @@ dependencies = [
"quick-error",
]
[[package]]
name = "git-testtools"
version = "0.1.0"
dependencies = [
"bstr",
"crc",
"once_cell",
"tempfile",
]
[[package]]
name = "git-transport"
version = "0.7.0"
@ -1961,16 +1971,6 @@ dependencies = [
"redox_termios",
]
[[package]]
name = "test-tools"
version = "0.1.0"
dependencies = [
"bstr",
"crc",
"once_cell",
"tempfile",
]
[[package]]
name = "textwrap"
version = "0.11.0"

2
git-commitgraph/Cargo.toml

@ -26,4 +26,4 @@ serde = { version = "1.0.114", optional = true, default-features = false, featur
thiserror = "1.0.20"
[dev-dependencies]
test-tools = { version = "0.1", path = "../tests/tools" }
git-testtools = { version = "0.1", path = "../tests/tools" }

2
git-commitgraph/tests/commitgraph.rs

@ -59,7 +59,7 @@ pub fn check_common(cg: &Graph, expected: &HashMap<String, RefInfo, impl BuildHa
);
}
use test_tools::scripted_fixture_repo_read_only;
use git_testtools::scripted_fixture_repo_read_only;
pub fn make_readonly_repo(script_path: &str) -> std::path::PathBuf {
scripted_fixture_repo_read_only(script_path).expect("script succeeds all the time")
}

2
git-diff/Cargo.toml

@ -20,4 +20,4 @@ quick-error = "2.0.0"
[dev-dependencies]
git-odb = { version = "0.12", path = "../git-odb" }
test-tools = { path = "../tests/tools" }
git-testtools = { path = "../tests/tools" }

2
git-diff/tests/visit/mod.rs

@ -8,7 +8,7 @@ mod changes {
fn db(args: impl IntoIterator<Item = &'static str>) -> crate::Result<linked::Db> {
linked::Db::at(
test_tools::scripted_fixture_repo_read_only_with_args("make_diff_repo.sh", args)?
git_testtools::scripted_fixture_repo_read_only_with_args("make_diff_repo.sh", args)?
.join(".git")
.join("objects"),
)

2
git-odb/Cargo.toml

@ -55,4 +55,4 @@ pretty_assertions = "0.7.1"
bstr = { version = "0.2.13", default-features = false, features = ["std"] }
hex = "0.4.2"
common_macros = "0.1.1"
test-tools = { version = "0.1", path = "../tests/tools"}
git-testtools = { version = "0.1", path = "../tests/tools"}

6
git-odb/tests/odb/alternate/mod.rs

@ -35,7 +35,7 @@ fn alternate_with(
#[test]
fn circular_alternates_are_detected_with_relative_paths() -> crate::Result {
let tmp = test_tools::tempfile::TempDir::new()?;
let tmp = git_testtools::tempfile::TempDir::new()?;
let (from, _) = alternate(tmp.path().join("a"), tmp.path().join("b"))?;
alternate(tmp.path().join("b"), Path::new("..").join("a"))?;
@ -56,7 +56,7 @@ fn circular_alternates_are_detected_with_relative_paths() -> crate::Result {
#[test]
fn single_link_with_comment_before_path_and_ansi_c_escape() -> crate::Result {
let tmp = test_tools::tempfile::TempDir::new()?;
let tmp = git_testtools::tempfile::TempDir::new()?;
let non_alternate = tmp.path().join("actual");
// let (from, to) = alternate_with(tmp.path().join("a"), non_alternate, Some("# comment\n\"../a\"\n"))?;
@ -69,7 +69,7 @@ fn single_link_with_comment_before_path_and_ansi_c_escape() -> crate::Result {
#[test]
fn no_alternate_in_first_objects_dir() -> crate::Result {
let tmp = test_tools::tempfile::TempDir::new()?;
let tmp = git_testtools::tempfile::TempDir::new()?;
assert!(alternate::resolve(tmp.path())?.is_empty());
Ok(())
}

4
git-odb/tests/odb/linked/mod.rs

@ -59,7 +59,7 @@ mod init {
#[test]
fn multiple_linked_repositories_via_alternates() -> crate::Result {
let tmp = test_tools::tempfile::TempDir::new()?;
let tmp = git_testtools::tempfile::TempDir::new()?;
let (object_path, linked_object_path) = alternate(tmp.path().join("a"), tmp.path().join("b"))?;
let db = linked::Db::try_from(object_path.clone())?;
assert_eq!(db.dbs.len(), 2);
@ -70,7 +70,7 @@ mod init {
#[test]
fn a_linked_db_without_alternates() -> crate::Result {
let tmp = test_tools::tempfile::TempDir::new()?;
let tmp = git_testtools::tempfile::TempDir::new()?;
let db = linked::Db::at(tmp.path())?;
assert_eq!(db.dbs.len(), 1);
assert_eq!(db.dbs[0].loose.path, tmp.path());

2
git-odb/tests/odb/mod.rs

@ -1,4 +1,4 @@
pub use test_tools::{fixture_path, scripted_fixture_repo_read_only};
pub use git_testtools::{fixture_path, scripted_fixture_repo_read_only};
pub type Result<T = ()> = std::result::Result<T, Box<dyn std::error::Error>>;

6
tests/tools/Cargo.toml

@ -1,10 +1,10 @@
[package]
name = "test-tools"
description = "utilities specifically for our crate test suites and journey tests"
name = "git-testtools"
description = "Shared code for gitoxide crates to facilitate testing"
version = "0.1.0"
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
edition = "2018"
publish = false
license = "MIT OR Apache-2.0"
[[bin]]
name = "jtt"

Loading…
Cancel
Save