Added target awareness and fixed property based test json output

This commit is contained in:
Riley-Kilgore
2024-10-22 09:48:26 -07:00
committed by KtorZ
parent d1a1d0ec01
commit 1a75568027
2 changed files with 42 additions and 24 deletions

View File

@@ -591,10 +591,22 @@ fn fmt_overall_summary_json(tests: &[TestResult<UntypedExpr, UntypedExpr>]) -> s
let (max_mem, max_cpu, max_iter) = find_max_execution_units(tests);
// Separate counts for unit tests and property-based tests
let unit_tests = tests
.iter()
.filter(|t| matches!(t, TestResult::UnitTestResult { .. }))
.count();
let property_tests = tests
.iter()
.filter(|t| matches!(t, TestResult::PropertyTestResult { .. }))
.count();
json!({
"total_tests": total,
"passed_tests": passed,
"failed_tests": failed,
"unit_tests": unit_tests,
"property_tests": property_tests,
"module_count": module_count,
"max_execution_units": {
"memory": max_mem,
@@ -605,7 +617,7 @@ fn fmt_overall_summary_json(tests: &[TestResult<UntypedExpr, UntypedExpr>]) -> s
json!({
"name": module,
"tests": results.iter().map(|r| fmt_test_json(r)).collect::<Vec<_>>(),
"summary": fmt_test_summary_json(&results),
"summary": fmt_test_summary_json(&results)
})
}).collect::<Vec<_>>(),
})