@@ -60,29 +60,28 @@ jobs:
6060 run : |
6161 set +e
6262 cd qemu_runner
63- make rerun_ctest
64- # 2>&1 | tee output.log
63+ make rerun_ctest 2>&1 | tee output.log
6564
6665 exit_code=${PIPESTATUS[0]}
6766
6867 # Parse test results
69- # if grep -q "tests passed" output.log; then
70- # result_line=$(grep "tests passed" output.log | tail -1)
71- # # Extract numbers: "X% tests passed, Y tests failed out of Z"
72- # passed=$(echo "$result_line" | grep -oP '\d+(?=% tests passed)')
73- # failed=$(echo "$result_line" | grep -oP '\d+(?= tests failed)')
74- # total=$(echo "$result_line" | grep -oP '(?<=out of )\d+')
68+ if grep -q "tests passed" output.log; then
69+ result_line=$(grep "tests passed" output.log | tail -1)
70+ # Extract numbers: "X% tests passed, Y tests failed out of Z"
71+ passed=$(echo "$result_line" | grep -oP '\d+(?=% tests passed)')
72+ failed=$(echo "$result_line" | grep -oP '\d+(?= tests failed)')
73+ total=$(echo "$result_line" | grep -oP '(?<=out of )\d+')
7574
76- # echo "passed_percent=$passed" >> $GITHUB_OUTPUT
77- # echo "failed=$failed" >> $GITHUB_OUTPUT
78- # echo "total=$total" >> $GITHUB_OUTPUT
79- # echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
80- # else
81- # echo "passed_percent=0" >> $GITHUB_OUTPUT
82- # echo "failed=-1" >> $GITHUB_OUTPUT
83- # echo "total=0" >> $GITHUB_OUTPUT
84- # echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
85- # fi
75+ echo "passed_percent=$passed" >> $GITHUB_OUTPUT
76+ echo "failed=$failed" >> $GITHUB_OUTPUT
77+ echo "total=$total" >> $GITHUB_OUTPUT
78+ echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
79+ else
80+ echo "passed_percent=0" >> $GITHUB_OUTPUT
81+ echo "failed=-1" >> $GITHUB_OUTPUT
82+ echo "total=0" >> $GITHUB_OUTPUT
83+ echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
84+ fi
8685
8786 - name : Print test summary
8887 if : always()
0 commit comments