Skip to content

Commit 17e6aa9

Browse files
committed
test(sys): ctest for experimental sha256 OID support
1 parent e3ebb0d commit 17e6aa9

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- run: cargo test --locked
3737
- run: cargo test --features https,ssh
3838
- run: cargo run -p systest
39+
- run: cargo run -p systest --features unstable-sha256
3940
- run: cargo test -p git2-curl
4041

4142
rustfmt:

systest/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ libc = "0.2"
1111

1212
[build-dependencies]
1313
ctest2 = "0.4"
14+
15+
[features]
16+
unstable-sha256 = ["libgit2-sys/unstable-sha256"]

systest/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ fn main() {
66
if let Some(root) = env::var_os("DEP_GIT2_ROOT") {
77
cfg.include(PathBuf::from(root).join("include"));
88
}
9+
10+
// Enable the unstable-sha256 rust cfg
11+
// so ctest2 sees the correct function signatures
12+
if env::var("CARGO_FEATURE_UNSTABLE_SHA256").is_ok() {
13+
cfg.cfg("feature", Some("unstable-sha256"));
14+
cfg.define("GIT_EXPERIMENTAL_SHA256", Some("1"));
15+
}
16+
917
cfg.header("git2.h")
1018
.header("git2/sys/errors.h")
1119
.header("git2/sys/transport.h")

0 commit comments

Comments
 (0)