mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-19 08:39:02 +03:00
test(cli-rs): remove superseded native plugin runs
Share the SDK table with the loopback and keep differences explicit in hand-written ABI fixtures. Build the quick start like the sample and read the load and setup statistics in that same test. The retained tests cover the removed cases: - `a_host_call_from_another_thread_is_refused` checks the thread gate, before request dispatch. The read/verb carrier row covers dispatch. - `a_call_that_panics_has_no_effects` checks failed commands; `a_panic_drops_a_fetch_asked_for_in_the_same_turn` checks late effects. - `a_wake_runs_the_wake_handlers_then_renders_on_both_paths` exercises thread-to-render delivery; keep the distinct full-queue cases. - `conformance::tests::the_version_gate_is_exact` runs the version grid.
This commit is contained in:
@@ -2231,7 +2231,18 @@ fn loopback_with(
|
||||
create: unsafe extern "C" fn(*const HostApi, Bytes, *mut *mut c_void, *mut Owned) -> i32,
|
||||
describe: unsafe extern "C" fn(*mut Owned) -> i32,
|
||||
) -> Result<(Definition, ErrorFn), String> {
|
||||
let api = PluginApi {
|
||||
let api = sdk_table(create, describe);
|
||||
// The shims would silence the process's panic hook on their first `create`, as a plugin's own std does; the process
|
||||
// here keeps its own. Taking and setting the hook around each load would race other threads' loads.
|
||||
abi::runtime::keep_panic_hook();
|
||||
Library::from_table(&api).and_then(|library| define(library, None))
|
||||
}
|
||||
|
||||
fn sdk_table(
|
||||
create: unsafe extern "C" fn(*const HostApi, Bytes, *mut *mut c_void, *mut Owned) -> i32,
|
||||
describe: unsafe extern "C" fn(*mut Owned) -> i32,
|
||||
) -> PluginApi {
|
||||
PluginApi {
|
||||
size: size_of::<PluginApi>(),
|
||||
major: ABI_MAJOR,
|
||||
minor: ABI_MINOR,
|
||||
@@ -2241,11 +2252,7 @@ fn loopback_with(
|
||||
destroy: Some(abi::runtime::destroy),
|
||||
free: Some(abi::runtime::free),
|
||||
describe: Some(describe),
|
||||
};
|
||||
// The shims would silence the process's panic hook on their first `create`, as a plugin's own std does; the process
|
||||
// here keeps its own. Taking and setting the hook around each load would race other threads' loads.
|
||||
abi::runtime::keep_panic_hook();
|
||||
Library::from_table(&api).and_then(|library| define(library, None))
|
||||
}
|
||||
}
|
||||
|
||||
/// The definition of the plugin whose table `api` is, as a library's: the conformance tests' reference and the plugin
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user