Make modules with tests runnable

Fixes #154
This commit is contained in:
Jan Jansen 2018-12-27 21:45:16 +01:00
parent 6908268712
commit 05daa86634
8 changed files with 288 additions and 63 deletions

View file

@ -257,6 +257,7 @@ pub fn handle_runnables(
range: runnable.range.conv_with(&line_index),
label: match &runnable.kind {
RunnableKind::Test { name } => format!("test {}", name),
RunnableKind::TestMod { path } => format!("test-mod {}", path),
RunnableKind::Bin => "run binary".to_string(),
},
bin: "cargo".to_string(),
@ -308,6 +309,15 @@ pub fn handle_runnables(
res.push(name.to_string());
res.push("--nocapture".to_string());
}
RunnableKind::TestMod { path } => {
res.push("test".to_string());
if let Some(spec) = spec {
spec.push_to(&mut res);
}
res.push("--".to_string());
res.push(path.to_string());
res.push("--nocapture".to_string());
}
RunnableKind::Bin => {
res.push("run".to_string());
if let Some(spec) = spec {