clm_rust_core/
runtime_dispatch.rs1pub fn petri_run_net(topo_file: &str, clm_root: &str) -> Result<String, String> {
8 crate::cpn::vm::petri_run_net(topo_file, clm_root)
9}
10
11#[cfg(test)]
12mod tests {
13 use super::*;
14 use std::io::Write;
15
16 #[test]
17 fn test_dispatch_native_backend() {
18 let dir = std::env::temp_dir().join("clm_runtime_dispatch_native_test");
22 std::fs::create_dir_all(&dir).unwrap();
23 let path = dir.join("net.yaml");
24 {
25 let mut f = std::fs::File::create(&path).unwrap();
26 f.write_all(b"not a valid topology\n").unwrap();
27 }
28 let result = petri_run_net(path.to_str().unwrap(), "/tmp/clm_root");
29 assert!(result.is_err());
30 }
31}