diff --git a/plugins/coco_coverage/src/lib.rs b/plugins/coco_coverage/src/lib.rs index b937bd43..49461f11 100644 --- a/plugins/coco_coverage/src/lib.rs +++ b/plugins/coco_coverage/src/lib.rs @@ -29,8 +29,38 @@ use std::{process, thread}; use grcov::*; +use core_model::CocoConfig; +use plugin_interface::PluginInterface; + +pub struct CocoCoverage {} + +impl PluginInterface for CocoCoverage { + fn name(&self) -> &'static str { + "coco.coverage" + } + + fn on_plugin_load(&self) {} + + fn on_plugin_unload(&self) {} + + fn execute(&self, config: CocoConfig) { + println!("{:?}", config); + } +} + +impl Default for CocoCoverage { + fn default() -> Self { + CocoCoverage {} + } +} + +#[no_mangle] +pub fn plugin() -> Box { + Box::new(CocoCoverage::default()) +} + #[allow(dead_code)] -fn main() { +fn run() { let default_num_threads = 1.max(num_cpus::get() - 1).to_string(); let matches = App::new("grcov") diff --git a/plugins/coco_struct_analysis/src/lib.rs b/plugins/coco_struct_analysis/src/lib.rs index 115cc24c..cf4e165f 100644 --- a/plugins/coco_struct_analysis/src/lib.rs +++ b/plugins/coco_struct_analysis/src/lib.rs @@ -1,4 +1,29 @@ -#[allow(dead_code)] -fn main() { - println!("Hello, world!"); +use core_model::CocoConfig; +use plugin_interface::PluginInterface; + +pub struct CocoStructAnslysis {} + +impl PluginInterface for CocoStructAnslysis { + fn name(&self) -> &'static str { + "coco.struct_analysis" + } + + fn on_plugin_load(&self) {} + + fn on_plugin_unload(&self) {} + + fn execute(&self, config: CocoConfig) { + println!("{:?}", config); + } +} + +impl Default for CocoStructAnslysis { + fn default() -> Self { + CocoStructAnslysis {} + } +} + +#[no_mangle] +pub fn plugin() -> Box { + Box::new(CocoStructAnslysis::default()) }