History

more cleanup of test crates

Sebastian Thiel committed 3 years ago

Commit 73c685a1 parent e0c64fd18 files · +29 −55Browse files

Unified · Split

18 files
  1. Cargo.lock +4 −8
  2. gix-config/tests/Cargo.toml +1 −16
  3. gix-config/tests/file/init/from_env.rs +1 −1
  4. gix-config/tests/file/init/from_paths/includes/conditional/gitdir/util.rs +2 −2
  5. gix-config/tests/file/init/from_paths/includes/conditional/mod.rs +1 −1
  6. gix-config/tests/file/init/from_paths/includes/conditional/onbranch.rs +6 −3
  7. gix-config/tests/file/init/from_paths/includes/unconditional.rs +1 −1
  8. gix-config/tests/file/init/from_paths/mod.rs +3 −3
  9. gix-diff/tests/Cargo.toml +2 −6
  10. gix-index/tests/Cargo.toml +0 −3
  11. gix-pack/tests/Cargo.toml +1 −3
  12. gix-pack/tests/pack/bundle.rs +1 −1
  13. gix-pack/tests/pack/data/output/count_and_entries.rs +1 −1
  14. gix-pack/tests/pack/multi_index/write.rs +1 −1
  15. gix-status/tests/Cargo.toml +1 −1
  16. gix-traverse/tests/Cargo.toml +1 −2
  17. gix-worktree-state/tests/Cargo.toml +1 −1
  18. gix-worktree/tests/Cargo.toml +1 −1
Cargo.lock+4−8
@@ -1427,16 +1427,13 @@ name = "gix-config-tests" · 1426 unmodified lines
14271427 version = "0.0.0"
14281428 dependencies = [
14291429 "bstr",
1430− "criterion",
14311430 "gix",
14321431 "gix-config",
14331432 "gix-path 0.8.4",
14341433 "gix-ref 0.34.0",
14351434 "gix-sec 0.8.4",
14361435 "gix-testtools",
1437− "serde_derive",
14381436 "serial_test",
1439− "tempfile",
14401437 ]
14411438
14421439 [[package]]
@@ -1946,7 +1943,7 @@ dependencies = [ · 503 unmodified lines
19461943
19471944 [[package]]
19481945 name = "gix-pack-tests"
1949−version = "0.30.1"
1946+version = "0.0.0"
19501947 dependencies = [
19511948 "bstr",
19521949 "gix-features 0.32.1",
@@ -1958,7 +1955,6 @@ dependencies = [ · 5 unmodified lines
19581955 "gix-traverse 0.31.0",
19591956 "maplit",
19601957 "memmap2 0.7.1",
1961− "tempfile",
19621958 ]
19631959
19641960 [[package]]
@@ -2244,7 +2240,7 @@ dependencies = [ · 279 unmodified lines
22442240
22452241 [[package]]
22462242 name = "gix-status-tests"
2247−version = "0.1.0"
2243+version = "0.0.0"
22482244 dependencies = [
22492245 "bstr",
22502246 "filetime",
@@ -2523,7 +2519,7 @@ dependencies = [ · 272 unmodified lines
25232519
25242520 [[package]]
25252521 name = "gix-worktree-state-tests"
2526−version = "0.1.0"
2522+version = "0.0.0"
25272523 dependencies = [
25282524 "gix-discover 0.23.0",
25292525 "gix-features 0.32.1",
@@ -2561,7 +2557,7 @@ dependencies = [ · 31 unmodified lines
25612557
25622558 [[package]]
25632559 name = "gix-worktree-tests"
2564−version = "0.1.0"
2560+version = "0.0.0"
25652561 dependencies = [
25662562 "bstr",
25672563 "gix-attributes 0.16.0",
gix-config/tests/Cargo.toml+1−16
@@ -2,13 +2,10 @@ · 1 unmodified line
22 name = "gix-config-tests"
33 version = "0.0.0"
44 repository = "https://github.com/Byron/gitoxide"
5−description = "A git-config file parser and editor from the gitoxide project"
5+description = "Tests for the gix-config crate"
66 license = "MIT OR Apache-2.0"
77 authors = ["Edward Shen <code@eddie.sh>"]
88 edition = "2021"
9−keywords = ["git-config", "git", "config", "gitoxide"]
10−categories = ["config", "parser-implementations"]
11−include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]
129 rust-version = "1.65"
1310 publish = false
1411
@@ -17,10 +14,6 @@ publish = false · 2 unmodified lines
1714 name = "config"
1815 path = "config.rs"
1916
20−[features]
21−## Data structures implement `serde::Serialize` and `serde::Deserialize`.
22−serde = ["gix-config/serde"]
23−
2417 [dev-dependencies]
2518 gix-config = { path = ".."}
2619 gix-testtools = { path = "../../tests/tools"}
@@ -29,12 +22,4 @@ gix-ref = { path = "../../gix-ref" } · 2 unmodified lines
2922 gix-path = { path = "../../gix-path" }
3023 gix-sec = { path = "../../gix-sec" }
3124 serial_test = { version = "2.0.0", default-features = false }
32−serde_derive = "1.0"
33−criterion = "0.5.1"
34−tempfile = "3.2.0"
3525 bstr = { version = "1.3.0", default-features = false, features = ["std"] }
36−
37−[package.metadata.docs.rs]
38−all-features = true
39−features = ["document-features"]
40−rustdoc-args = ["--cfg", "docsrs"]
gix-config/tests/file/init/from_env.rs+1−1
@@ -4,9 +4,9 @@ use gix_config::{ · 3 unmodified lines
44 file::{includes, init, init::from_env},
55 File,
66 };
7+use gix_testtools::tempfile::tempdir;
78 use gix_testtools::Env;
89 use serial_test::serial;
9−use tempfile::tempdir;
1010
1111 use crate::file::init::from_paths::escape_backslashes;
1212
gix-config/tests/file/init/from_paths/includes/conditional/gitdir/util.rs+2−2
@@ -19,7 +19,7 @@ use crate::file::{ · 18 unmodified lines
1919
2020 #[derive(Debug)]
2121 pub struct GitEnv {
22− tempdir: tempfile::TempDir,
22+ tempdir: gix_testtools::tempfile::TempDir,
2323 root_dir: PathBuf,
2424 git_dir: PathBuf,
2525 home_dir: PathBuf,
@@ -68,7 +68,7 @@ impl Condition { · 42 unmodified lines
6868
6969 impl GitEnv {
7070 pub fn repo_name(repo_name: impl AsRef<Path>) -> crate::Result<Self> {
71− let tempdir = tempfile::tempdir()?;
71+ let tempdir = gix_testtools::tempfile::tempdir()?;
7272 let root_dir = gix_path::realpath(tempdir.path())?;
7373 let worktree_dir = root_dir.join(repo_name);
7474 std::fs::create_dir_all(&worktree_dir)?;
gix-config/tests/file/init/from_paths/includes/conditional/mod.rs+1−1
@@ -4,7 +4,7 @@ use gix_config::{ · 3 unmodified lines
44 file::{includes, init},
55 path, File,
66 };
7−use tempfile::tempdir;
7+use gix_testtools::tempfile::tempdir;
88
99 use crate::file::{cow_str, init::from_paths::escape_backslashes};
1010
gix-config/tests/file/init/from_paths/includes/conditional/onbranch.rs+6−3
@@ -13,7 +13,7 @@ use gix_ref::{ · 12 unmodified lines
1313 transaction::{Change, PreviousValue, RefEdit},
1414 FullName, Target,
1515 };
16−use tempfile::tempdir;
16+use gix_testtools::tempfile::tempdir;
1717
1818 use crate::file::{cow_str, init::from_paths::includes::conditional::git_init};
1919
@@ -181,7 +181,7 @@ enum Value { · 161 unmodified lines
181181 #[derive(Debug)]
182182 struct GitEnv {
183183 repo: gix::Repository,
184− dir: tempfile::TempDir,
184+ dir: gix_testtools::tempfile::TempDir,
185185 }
186186
187187 impl GitEnv {
@@ -291,7 +291,10 @@ value = branch-override-by-include · 103 unmodified lines
291291 Ok(GitEnv { repo, dir })
292292 }
293293
294−fn assure_git_agrees(expected: Value, dir: tempfile::TempDir) -> crate::Result<tempfile::TempDir> {
294+fn assure_git_agrees(
295+ expected: Value,
296+ dir: gix_testtools::tempfile::TempDir,
297+) -> crate::Result<gix_testtools::tempfile::TempDir> {
295298 let git_dir = dir.path();
296299 let output = std::process::Command::new("git")
297300 .args(["config", "--get", "section.value"])
gix-config/tests/file/init/from_paths/includes/unconditional.rs+1−1
@@ -4,7 +4,7 @@ use gix_config::{ · 3 unmodified lines
44 file::{includes, init, init::from_paths},
55 File,
66 };
7−use tempfile::tempdir;
7+use gix_testtools::tempfile::tempdir;
88
99 use crate::file::{
1010 cow_str,
gix-config/tests/file/init/from_paths/mod.rs+3−3
@@ -1,7 +1,7 @@
11 use std::{fs, path::PathBuf};
22
33 use gix_config::{File, Source};
4−use tempfile::tempdir;
4+use gix_testtools::tempfile::tempdir;
55
66 use crate::file::cow_str;
77
@@ -13,7 +13,7 @@ pub(crate) fn escape_backslashes(path: impl AsRef<std::path::Path>) -> String { · 5 unmodified lines
1313 mod from_path_no_includes {
1414 #[test]
1515 fn file_not_found() {
16− let dir = tempfile::tempdir().unwrap();
16+ let dir = gix_testtools::tempfile::tempdir().unwrap();
1717 let config_path = dir.path().join("config");
1818
1919 let err = gix_config::File::from_path_no_includes(config_path, gix_config::Source::Local).unwrap_err();
@@ -24,7 +24,7 @@ mod from_path_no_includes { · 4 unmodified lines
2424
2525 #[test]
2626 fn single_path() {
27− let dir = tempfile::tempdir().unwrap();
27+ let dir = gix_testtools::tempfile::tempdir().unwrap();
2828 let config_path = dir.path().join("config");
2929 std::fs::write(config_path.as_path(), b"[core]\nboolean = true").unwrap();
3030
gix-diff/tests/Cargo.toml+2−6
@@ -4,18 +4,14 @@ version = "0.0.0" · 3 unmodified lines
44 publish = false
55 repository = "https://github.com/Byron/gitoxide"
66 license = "MIT OR Apache-2.0"
7−description = "Please use `gix-<thiscrate>` instead ('git' -> 'gix')"
7+description = "Tests for the gix-diff crate"
88 authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
99 edition = "2021"
10−include = ["src/**/*"]
1110 rust-version = "1.65"
1211
13−[features]
14−serde = ["gix-diff/serde", "gix-hash/serde", "gix-object/serde"]
15−
1612 [[test]]
17−name = "diff"
1813 doctest = false
14+name = "diff"
1915 path = "diff.rs"
2016
2117 [dev-dependencies]
gix-index/tests/Cargo.toml+0−3
@@ -13,12 +13,9 @@ rust-version = "1.65" · 12 unmodified lines
1313 name = "integrate"
1414 path = "integrate.rs"
1515
16−
1716 [features]
1817 gix-features-parallel = ["gix-features/parallel"]
1918
20−[dependencies]
21−
2219 [dev-dependencies]
2320 gix-index = { path = ".." }
2421 gix-features = { path = "../../gix-features", features = ["rustsha1", "progress"] }
gix-pack/tests/Cargo.toml+1−3
@@ -1,12 +1,11 @@
11 [package]
22 name = "gix-pack-tests"
3−version = "0.30.1"
3+version = "0.0.0"
44 repository = "https://github.com/Byron/gitoxide"
55 authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
66 license = "MIT OR Apache-2.0"
77 description = "Please use `gix-<thiscrate>` instead ('git' -> 'gix')"
88 edition = "2018"
9−include = ["src/**/*", "CHANGELOG.md"]
109 rust-version = "1.65"
1110
1211 [features]
@@ -22,7 +21,6 @@ gix-pack = { path = ".." } · 9 unmodified lines
2221 gix-features = { path = "../../gix-features" }
2322 gix-testtools = { path = "../../tests/tools"}
2423 gix-odb = { path = "../../gix-odb" }
25−tempfile = "3.1.0"
2624 bstr = { version = "1.3.0", default-features = false, features = ["std"] }
2725 maplit = "1.0.2"
2826 gix-object = { path = "../../gix-object" }
gix-pack/tests/pack/bundle.rs+1−1
@@ -80,7 +80,7 @@ mod write_to_directory { · 79 unmodified lines
8080
8181 use gix_features::progress;
8282 use gix_odb::pack;
83− use tempfile::TempDir;
83+ use gix_testtools::tempfile::TempDir;
8484
8585 use crate::{
8686 fixture_path,
gix-pack/tests/pack/data/output/count_and_entries.rs+1−1
@@ -339,7 +339,7 @@ fn write_and_verify( · 338 unmodified lines
339339 _expected_pack_hash: gix_hash::ObjectId,
340340 _expected_thin_pack_hash: Option<gix_hash::ObjectId>,
341341 ) -> crate::Result {
342− let tmp_dir = tempfile::TempDir::new()?;
342+ let tmp_dir = gix_testtools::tempfile::TempDir::new()?;
343343 let pack_file_path = tmp_dir.path().join("new.pack");
344344 let mut pack_file = std::fs::OpenOptions::new()
345345 .write(true)
gix-pack/tests/pack/multi_index/write.rs+1−1
@@ -7,7 +7,7 @@ use crate::hex_to_id; · 6 unmodified lines
77
88 #[test]
99 fn from_paths() -> crate::Result {
10− let dir = tempfile::TempDir::new()?;
10+ let dir = gix_testtools::tempfile::TempDir::new()?;
1111 let input_indices = std::fs::read_dir(fixture_path_standalone("objects/pack"))?
1212 .filter_map(|r| {
1313 r.ok()
gix-status/tests/Cargo.toml+1−1
@@ -1,6 +1,6 @@
11 [package]
22 name = "gix-status-tests"
3−version = "0.1.0"
3+version = "0.0.0"
44 repository = "https://github.com/Byron/gitoxide"
55 license = "MIT OR Apache-2.0"
66 description = "A crate to drive gix-status tests with different features"
gix-traverse/tests/Cargo.toml+1−2
@@ -3,10 +3,9 @@ name = "gix-traverse-tests" · 2 unmodified lines
33 version = "0.0.0"
44 repository = "https://github.com/Byron/gitoxide"
55 license = "MIT OR Apache-2.0"
6−description = "Please use `gix-<thiscrate>` instead ('git' -> 'gix')"
6+description = "Integration tests for the gix-traverse crate"
77 authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
88 edition = "2021"
9−include = ["src/**/*"]
109 rust-version = "1.65"
1110
1211 [[test]]
gix-worktree-state/tests/Cargo.toml+1−1
@@ -1,6 +1,6 @@
11 [package]
22 name = "gix-worktree-state-tests"
3−version = "0.1.0"
3+version = "0.0.0"
44 repository = "https://github.com/Byron/gitoxide"
55 license = "MIT OR Apache-2.0"
66 description = "A crate for running tests with feature toggles on gix-worktree-state"
gix-worktree/tests/Cargo.toml+1−1
@@ -1,6 +1,6 @@
11 [package]
22 name = "gix-worktree-tests"
3−version = "0.1.0"
3+version = "0.0.0"
44 repository = "https://github.com/Byron/gitoxide"
55 license = "MIT OR Apache-2.0"
66 description = "A crate for testing the gix-worktree crate with feature toggles"