Skip to content

Commit

Permalink
fix(rerunners): correct handling of analysis from indexes only.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnbln committed Jan 25, 2024
1 parent 656502e commit be4f344
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cargo-difftests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,7 @@ pub fn run_analyze_all_from_index(
results.push(result);
}

let out_json = serde_json::to_string(&results)?;
println!("{out_json}");
action_args.perform_for(&results)?;

Ok(())
}
Expand Down
7 changes: 6 additions & 1 deletion cargo-difftests/src/test_rerunner_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct TestRerunnerInvocation {

impl TestRerunnerInvocation {
pub fn create_invocation_from<'a>(
iter: impl IntoIterator<Item = &'a AnalyzeAllSingleTestGroup>
iter: impl IntoIterator<Item = &'a AnalyzeAllSingleTestGroup>,
) -> DifftestsResult<Self> {
let mut tests = vec![];
let mut groups = vec![];
Expand All @@ -20,6 +20,11 @@ impl TestRerunnerInvocation {
tests.push(difftest.load_test_desc()?);
} else if let Some(difftest_group) = &g.difftest_group {
groups.push(difftest_group.load_self_json()?);
} else {
// Most likely came from an index.
assert_eq!(g.test_desc.len(), 1);
let [test] = g.test_desc.as_slice() else { unreachable!() };
tests.push(test.clone());
}
}

Expand Down

0 comments on commit be4f344

Please sign in to comment.