Skip to content

Commit

Permalink
Switch test support to small-ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Aug 6, 2024
1 parent f095bf8 commit 906c006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ all-features = true

[features]
default = ["backtrace", "safe-shared-libraries"]
test-support = ["ctor"]
test-support = ["small_ctor"]
json = ["serde_json"]
safe-shared-libraries = ["findshlibs"]

Expand All @@ -30,9 +30,9 @@ ipc-channel = "0.18.2"
serde = { version = "1.0.104", features = ["derive"] }
backtrace = { version = "0.3.43", optional = true, features = ["serde"] }
libc = "0.2.66"
ctor = { version = "0.1.20", optional = true }
serde_json = { version = "1.0.47", optional = true }
findshlibs = { version = "0.10.2", optional = true }
small_ctor = { version = "0.1.2", optional = true }

[target."cfg(windows)".dependencies]
winapi = { version = "0.3.9", features = [
Expand Down
4 changes: 2 additions & 2 deletions src/testsupport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static TEST_MODE: AtomicBool = AtomicBool::new(false);
static TEST_MODULE: AtomicPtr<String> = AtomicPtr::new(std::ptr::null_mut());

// we need this.
pub use ctor::ctor;
pub use small_ctor::ctor;

/// Supports the use of procspawn in tests.
///
Expand All @@ -26,7 +26,7 @@ pub use ctor::ctor;
macro_rules! enable_test_support {
() => {
#[$crate::testsupport::ctor]
fn __procspawn_test_support_init() {
unsafe fn __procspawn_test_support_init() {
// strip the crate name from the module path
let module_path = std::module_path!().splitn(2, "::").nth(1);
$crate::testsupport::enable(module_path);
Expand Down

0 comments on commit 906c006

Please sign in to comment.