Skip to content

Commit

Permalink
fixup! build: added ENABLE_MOCK_TOR_PROVIDER cmake build flag
Browse files Browse the repository at this point in the history
fix spacing
  • Loading branch information
Richard Pospesel committed Apr 2, 2024
1 parent 183e973 commit 657584d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions source/gosling/crates/cgosling/Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ static_assertions = "1.1"
tor-interface = { path = "../tor-interface" }
which = "4.4"

[dev-dependencies]
serial_test = "0.9"

[lib]
name = "cgosling"
crate-type = ["staticlib" ,"rlib"]
Expand Down
1 change: 1 addition & 0 deletions source/gosling/crates/cgosling/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] }

[dependencies.cgosling]
path = ".."
features = ["mock-tor-provider"]

# Prevent this from interfering with workspaces
[workspace]
Expand Down
4 changes: 4 additions & 0 deletions source/gosling/crates/cgosling/tests/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use std::sync::atomic::{AtomicBool, Ordering};

// external crates
use anyhow::bail;
#[cfg(test)]
use serial_test::serial;

// internal crates
use cgosling::ffi::*;
Expand Down Expand Up @@ -234,6 +236,7 @@ fn create_server_endpoint_handshake(context: *mut GoslingContext) -> anyhow::Res
}

#[test]
#[serial]
#[cfg(feature = "mock-tor-provider")]
fn test_gosling_ffi_handshake_mock_client() -> anyhow::Result<()> {
let library = test_gosling_ffi_handshake_preamble()?;
Expand All @@ -250,6 +253,7 @@ fn test_gosling_ffi_handshake_mock_client() -> anyhow::Result<()> {
}

#[test]
#[serial]
#[cfg(feature = "legacy-tor-provider")]
fn test_gosling_ffi_handshake_legacy_client() -> anyhow::Result<()> {
let library = test_gosling_ffi_handshake_preamble()?;
Expand Down
2 changes: 1 addition & 1 deletion source/gosling/crates/gosling/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ curve25519-dalek = "4.1"
data-encoding = "2.0"
honk-rpc = { path = "../../honk-rpc" }
libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] }
tor-interface = { path = "../../tor-interface" }
tor-interface = { path = "../../tor-interface", features = ["mock-tor-provider"] }

[dependencies.gosling]
path = ".."
Expand Down
1 change: 1 addition & 0 deletions source/gosling/crates/tor-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tor-llcrypto = { version = "0.7", features = ["relay"] }
anyhow = "1.0"
serial_test = "0.9"
which = "4.4"

[features]
mock-tor-provider = []
legacy-tor-provider = []

0 comments on commit 657584d

Please sign in to comment.