diff --git a/src/repo/testcases.rs b/src/repo/testcases.rs index b4f8098..837a67a 100644 --- a/src/repo/testcases.rs +++ b/src/repo/testcases.rs @@ -15,10 +15,20 @@ pub type PkgTests = IndexMap; // nextest reports all member tests even if it's run under a member, so we just run under workspace pub fn get(repo_root: &Utf8Path, workspace_root: &Utf8Path) -> Result { let summary = test_list(workspace_root)?; + let workspace_tests_count = summary.test_count; + // nextest will report all bins even if zero testcase, so don't show them + if workspace_tests_count == 0 { + return Ok(Default::default()); + } let mut map = PkgTests::with_capacity(summary.rust_suites.len()); for ele in summary.rust_suites.values() { + if ele.test_cases.is_empty() { + // skip zero testcase + continue; + } + let test = TestBinary::new(ele, repo_root); if let Some((_, _, tests)) = map.get_full_mut(&ele.package_name) { tests.tests.push(test);