Skip to content

Commit 93feea2

Browse files
committed
chore: split tests off into their own crate to allow feature toggles.
That way we can test with the `parallel` feature and won't have to create bogus feature toggles that are only used for testing, yet visbible to users.
1 parent ec1e550 commit 93feea2

35 files changed

+225
-180
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ members = [
281281

282282
"gix-diff/tests",
283283
"gix-pack/tests",
284+
"gix-worktree-state/tests",
285+
"gix-status/tests",
286+
"gix-worktree/tests",
284287
"gix-index/tests",
285288
"gix-ref/tests",
286289
"gix-config/tests",

gix-index/tests/Cargo.toml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,18 @@ 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 = "Integration tests for gix-index"
88
authors = ["Sebastian Thiel <[email protected]>"]
99
edition = "2021"
10-
include = ["src/**/*", "README.md", "CHANGELOG.md"]
1110
rust-version = "1.65"
1211

1312
[[test]]
14-
name = "multi-threaded"
15-
path = "index-multi-threaded.rs"
16-
required-features = ["internal-testing-gix-features-parallel"]
13+
name = "integrate"
14+
path = "integrate.rs"
1715

18-
[[test]]
19-
name = "single-threaded"
20-
path = "index-single-threaded.rs"
2116

2217
[features]
23-
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
24-
serde= ["gix-index/serde"]
25-
26-
internal-testing-gix-features-parallel = ["gix-features/parallel"]
18+
gix-features-parallel = ["gix-features/parallel"]
2719

2820
[dependencies]
2921

@@ -35,7 +27,3 @@ gix = { path = "../../gix"}
3527
gix-hash = { path = "../../gix-hash"}
3628
filetime = "0.2.15"
3729
bstr = { version = "1.3.0", default-features = false }
38-
39-
[package.metadata.docs.rs]
40-
features = ["document-features", "serde"]
41-
rustdoc-args = ["--cfg", "docsrs"]

gix-index/tests/index-multi-threaded.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

gix-index/tests/index-single-threaded.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

gix-index/tests/integrate.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub use gix_testtools::Result;
2+
3+
mod index;
4+
pub use index::*;

gix-pack/tests/Cargo.toml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,12 @@ include = ["src/**/*", "CHANGELOG.md"]
1010
rust-version = "1.65"
1111

1212
[features]
13-
14-
## Provide a fixed-size allocation-free LRU cache for packs. It's useful if caching is desired while keeping the memory footprint
15-
## for the LRU-cache itself low.
16-
pack-cache-lru-static = ["gix-pack/pack-cache-lru-static"]
17-
## Provide a hash-map based LRU cache whose eviction is based a memory cap calculated from object data.
18-
pack-cache-lru-dynamic = ["gix-pack/pack-cache-lru-dynamic"]
19-
## If set, select algorithms may additionally use a full-object cache which is queried before the pack itself.
20-
object-cache-dynamic = ["gix-pack/object-cache-dynamic"]
21-
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
22-
serde = ["gix-pack/serde"]
23-
24-
internal-testing-gix-features-parallel = ["gix-features/parallel"]
25-
26-
[[test]]
27-
name = "multi-threaded"
28-
path = "pack-multi-threaded.rs"
29-
required-features = ["internal-testing-gix-features-parallel"]
13+
gix-features-parallel = ["gix-features/parallel"]
14+
all-features = ["gix-pack/object-cache-dynamic", "gix-pack/pack-cache-lru-dynamic", "gix-pack/pack-cache-lru-static"]
3015

3116
[[test]]
32-
name = "single-threaded"
33-
path = "pack-single-threaded.rs"
17+
name = "pack"
18+
path = "integrate.rs"
3419

3520
[dev-dependencies]
3621
gix-pack = { path = ".." }

gix-pack/tests/integrate.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mod pack;
2+
use pack::*;

gix-pack/tests/pack-multi-threaded.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

gix-pack/tests/pack-single-threaded.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)