Skip to content

Commit

Permalink
testcases: skip zero testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Oct 27, 2024
1 parent 0686193 commit d0db5b1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/repo/testcases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ pub type PkgTests = IndexMap<String, TestCases>;
// 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<PkgTests> {
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);
Expand Down

0 comments on commit d0db5b1

Please sign in to comment.