Skip to content

Commit

Permalink
crash test
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Oct 1, 2023
1 parent e483c71 commit 9509fc9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
12 changes: 6 additions & 6 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@
// },

plugins: {
dds: {
__config__: "../zenoh-plugin-dds/config.json5",
__path__: [
"../zenoh-plugin-dds/target/debug/libzenoh_plugin_dds.so",
],
},
//dds: {
// __config__: "../zenoh-plugin-dds/config.json5",
// __path__: [
// "../zenoh-plugin-dds/target/debug/libzenoh_plugin_dds.so",
// ],
//},
example: {
__path__: [
"target/debug/libzenoh_plugin_example.so",
Expand Down
3 changes: 3 additions & 0 deletions plugins/example-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ name = "zenoh_plugin_example"
# This crate type will make `cargo` output a dynamic library instead of a rust static library
crate-type = ["cdylib"]

[features]
crashable = ["zenoh/crashable"]

[dependencies]
async-std = { workspace = true, features = ["default"] }
clap = { workspace = true }
Expand Down
16 changes: 10 additions & 6 deletions plugins/example-plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ impl Plugin for ExamplePlugin {

// The first operation called by zenohd on the plugin
fn start(name: &str, runtime: &Self::StartArgs) -> ZResult<Self::RunningPlugin> {
let dummy = runtime._dummy;
println!("dummy: {}", dummy);
eprintln!("edummy: {}", dummy);
info!("ldummy: {}", dummy);
if dummy {
panic!("FOOOO!!!!");

// panic!("panic");

#[cfg(feature="crashable")]
{
panic!("FOOOO!!!! : {}", runtime._dummy);
}
info!("example started");
println!("example started !");
panic!("example started !!");

let config = runtime.config.lock();
let self_cfg = config.plugin(name).unwrap().as_object().unwrap();
// get the plugin's config details from self_cfg Map (here the "storage-selector" property)
Expand Down

0 comments on commit 9509fc9

Please sign in to comment.