Merge branch 'dev'

This commit is contained in:
Matteo Flebus 2026-01-26 17:22:06 +01:00
commit f1ad31c442

View file

@ -125,7 +125,7 @@ check_result() {
echo -e ' ' "Expected code $ref_code but got $actual_code"
test_failed=1
# Check output
elif diff $output $ref_output > /dev/null; then
elif [[ $(diff $output $ref_output > /dev/null) -ne 0 ]]; then
echo -e $BRed "FAILED" $Color_Off
echo -e ' ' "on '$command'"
echo -e ' ' "Output is not the one expected"
@ -226,9 +226,13 @@ test_script() {
summarize() {
# Compute statistics
(( passed_tests = $total_tests - $errors_count ))
(( tests_percentage = 100 * $passed_tests / $total_tests ))
# Adapt color depending on results
# Percentage
if [[ tests_percentage -gt 80 ]]; then
coverage_color=$BGreen
elif [[ tests_percentage -gt 50 ]]; then
@ -238,12 +242,19 @@ summarize() {
else
coverage_color=$BRed
fi
# Timeouts
if [[ $timeouts_count -eq 0 ]]; then
timeouts_color=$BGreen
else
timeouts_color=$BRed
fi
# Print
echo -e $BWhite "\n\n""===========" $UWhite"Summary"$Color_Off "\n"
echo -e " Passed $coverage_color$passed_tests/$total_tests$Color_Off tests ($coverage_color$tests_percentage$Color_Off%)"
echo -e " Got $BRed$timeouts_count timeout(s)$Color_Off"
if [ "$OUTPUT_FILE" != "" ];
then echo $tests_percentage > "$OUTPUT_FILE";
echo -e " Got $timeouts_color$timeouts_count timeout(s)$Color_Off"
if [ "$OUTPUT_FILE" != "" ]; then
echo $tests_percentage > "$OUTPUT_FILE";
fi
echo