Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
ianks committed Aug 2, 2023
1 parent 691f039 commit 68ec6f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
16 changes: 9 additions & 7 deletions crates/rb-sys-test-helpers/src/ruby_test_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ impl RubyTestExecutor {
timeout: Duration::from_secs(10),
};

executor.run(|| {
static INIT: Once = Once::new();
executor
.run(|| {
static INIT: Once = Once::new();

INIT.call_once(|| unsafe {
setup_ruby_unguarded();
});
});
INIT.call_once(|| unsafe {
setup_ruby_unguarded();
})
})
.expect("Failed to setup Ruby");

executor
}
Expand All @@ -65,7 +67,7 @@ impl RubyTestExecutor {
pub fn shutdown(&mut self) {
self.set_test_timeout(Duration::from_secs(3));

self.run(|| unsafe {
let _ = self.run(|| unsafe {
cleanup_ruby();
});

Expand Down
1 change: 1 addition & 0 deletions crates/rb-sys-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ doc = false
rb-sys = { path = "../rb-sys", features = [
"link-ruby",
"stable-api-compiled-testing",
"rb-gc-guard",
] }
rb-sys-env = { path = "../rb-sys-env" }
rb-sys-test-helpers = { path = "../rb-sys-test-helpers" }
Expand Down
2 changes: 2 additions & 0 deletions crates/rb-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rb-sys-build = { version = "0.9.79", path = "../rb-sys-build" }

[dev-dependencies]
rb-sys = { path = ".", features = [
"rb-gc-guard",
"link-ruby",
"stable-api-compiled-fallback",
] }
Expand All @@ -37,6 +38,7 @@ stable-api-compiled-testing = [
] # For testing the fallback in rb-sys (internal)
stable-api-compiled-force = [] # Always use the compiled C API
ruby-macros = ["stable-api"] # deprecated
rb-gc-guard = [] # Needs asm features Rust 1.59+
bindgen-rbimpls = ["rb-sys-build/bindgen-rbimpls"]
bindgen-deprecated-types = ["rb-sys-build/bindgen-deprecated-types"]
bindgen-layout-tests = ["rb-sys-build/bindgen-layout-tests"]
Expand Down
2 changes: 1 addition & 1 deletion crates/rb-sys/src/stable_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub const fn get_default() -> &'static api::Definition {

/// Get the fallback stable API definition for the current Ruby version, which
/// is compiled C code that is linked into to this crate.
#[cfg(all(stable_api_enable_compiled_mod))]
#[cfg(stable_api_enable_compiled_mod)]
pub const fn get_compiled() -> &'static compiled::Definition {
const COMPILED_API: compiled::Definition = compiled::Definition {};
&COMPILED_API
Expand Down

0 comments on commit 68ec6f8

Please sign in to comment.