diff --git a/example-project/tests/rust.rs b/example-project/tests/rust.rs new file mode 100644 index 00000000..067cc77a --- /dev/null +++ b/example-project/tests/rust.rs @@ -0,0 +1,7 @@ +use example_project::OddCounter; + +#[test] +#[should_panic] +fn test() { + OddCounter::new(40).unwrap(); +} diff --git a/src/build.rs b/src/build.rs index 7f82b415..743ea552 100644 --- a/src/build.rs +++ b/src/build.rs @@ -101,7 +101,7 @@ fn patch_lib_kind_in_target(ws: &mut Workspace, libkinds: &[&str]) -> anyhow::Re let manifest = pkg.manifest_mut(); let targets = manifest.targets_mut(); - let kinds: Vec<_> = libkinds + let mut kinds: Vec<_> = libkinds .iter() .map(|&kind| match kind { "staticlib" => CrateType::Staticlib, @@ -110,6 +110,8 @@ fn patch_lib_kind_in_target(ws: &mut Workspace, libkinds: &[&str]) -> anyhow::Re }) .collect(); + kinds.push(CrateType::Lib); + for target in targets.iter_mut() { if target.is_lib() { target.set_kind(TargetKind::Lib(kinds.clone()));