Skip to content

Commit 73c685a

Browse files
committed
more cleanup of test crates
1 parent e0c64fd commit 73c685a

File tree

18 files changed

+29
-55
lines changed

18 files changed

+29
-55
lines changed

Cargo.lock

Lines changed: 4 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gix-config/tests/Cargo.toml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
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 <[email protected]>"]
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
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" }
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use gix_config::{
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::file::{
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 {
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use gix_config::{
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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use gix_ref::{
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 {
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
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use gix_config::{
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {
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 {
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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@ version = "0.0.0"
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 <[email protected]>"]
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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ rust-version = "1.65"
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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 <[email protected]>"]
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 = ".." }
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ mod write_to_directory {
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn write_and_verify(
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::hex_to_id;
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name = "gix-traverse-tests"
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 <[email protected]>"]
88
edition = "2021"
9-
include = ["src/**/*"]
109
rust-version = "1.65"
1110

1211
[[test]]

gix-worktree-state/tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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"

0 commit comments

Comments
 (0)