@@ -344,7 +344,7 @@ validate_unit_test_results() {
344344 local old_pwd=$( pwd)
345345 cd " $work_dir " || return 1
346346
347- # Always run validation with pretty-print first for detailed output
347+ # First run validation with pretty-print for detailed output
348348 local pretty_print_output
349349 log_info " → Running test result validation with detailed output..."
350350 if ! pretty_print_output=$( dotnet " $QLT_BINARY " test run validate-unit-tests --pretty-print --results-directory " $results_dir " 2>&1 ) ; then
@@ -358,35 +358,15 @@ validate_unit_test_results() {
358358 log_info " Validation output for $language :"
359359 echo " $pretty_print_output "
360360
361- # Parse the pretty-print output to determine if tests actually passed
362- local pass_count
363- pass_count=$( echo " $pretty_print_output " | grep -c " ✅ \[PASS\]" || true)
364- local fail_count
365- fail_count=$( echo " $pretty_print_output " | grep -c " ❌ \[FAIL\]" || true)
366-
367- # Ensure we have numeric values
368- [[ -z " $pass_count " ]] && pass_count=0
369- [[ -z " $fail_count " ]] && fail_count=0
370-
371- local total_tests=$(( pass_count + fail_count))
372-
373- if [[ $total_tests -eq 0 ]]; then
374- log_warning " No test results found in pretty-print output for $language "
375- log_info " → Running standard validation as fallback..."
376- local standard_output
377- if ! standard_output=$( dotnet " $QLT_BINARY " test run validate-unit-tests --results-directory " $results_dir " 2>&1 ) ; then
378- log_error " Standard validation also failed for $language "
379- log_error " Standard validation output:"
380- echo " $standard_output "
381- cd " $old_pwd "
382- return 1
383- fi
384- elif [[ $fail_count -gt 0 ]]; then
385- log_error " Test validation failed for $language : $fail_count failed out of $total_tests tests"
361+ # Also run the standard validation (without pretty-print) for authoritative exit code
362+ local standard_validation_output
363+ log_info " → Running standard validation for authoritative pass/fail result..."
364+ if ! standard_validation_output=$( dotnet " $QLT_BINARY " test run validate-unit-tests --results-directory " $results_dir " 2>&1 ) ; then
365+ log_error " Standard validation check failed for $language "
366+ log_error " Standard validation output:"
367+ echo " $standard_validation_output "
386368 cd " $old_pwd "
387369 return 1
388- else
389- log_info " All tests passed for $language : $pass_count out of $total_tests tests"
390370 fi
391371
392372 cd " $old_pwd "
@@ -663,10 +643,10 @@ main() {
663643 log_info " ========================================="
664644
665645 if validate_language " $language " ; then
666- (( passed++ ))
646+ passed= $ (( passed + 1 ))
667647 log_success " ✓ Language $language validation PASSED"
668648 else
669- (( failed++ ))
649+ failed= $ (( failed + 1 ))
670650 failed_languages+=(" $language " )
671651 log_error " ✗ Language $language validation FAILED"
672652 log_warning " Continuing with remaining languages..."
0 commit comments