mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-01 04:20:45 +00:00
Merge pull request #6808 from gilles-peskine-arm/basic-build-test-lcov-format-robustness-3.3
Fix code_coverage broken by extra echo in make lcov
This commit is contained in:
commit
bb12621746
@ -243,35 +243,16 @@ rm -f "tests/basic-build-test-$$.ok"
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
|
|
||||||
# Step 4e - Coverage
|
# Step 4e - Coverage report
|
||||||
echo "Coverage"
|
echo "Coverage statistics:"
|
||||||
|
sed -n '1,/^Overall coverage/d; /%/p' cov-$TEST_OUTPUT
|
||||||
LINES_TESTED=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ lines......: [0-9]*.[0-9]% (\([0-9]*\) of [0-9]* lines)/\1/p')
|
echo
|
||||||
LINES_TOTAL=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ lines......: [0-9]*.[0-9]% ([0-9]* of \([0-9]*\) lines)/\1/p')
|
|
||||||
FUNCS_TESTED=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ functions..: [0-9]*.[0-9]% (\([0-9]*\) of [0-9]* functions)$/\1/p')
|
|
||||||
FUNCS_TOTAL=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ functions..: [0-9]*.[0-9]% ([0-9]* of \([0-9]*\) functions)$/\1/p')
|
|
||||||
BRANCHES_TESTED=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ branches...: [0-9]*.[0-9]% (\([0-9]*\) of [0-9]* branches)$/\1/p')
|
|
||||||
BRANCHES_TOTAL=$(tail -n4 cov-$TEST_OUTPUT|sed -n -e 's/ branches...: [0-9]*.[0-9]% ([0-9]* of \([0-9]*\) branches)$/\1/p')
|
|
||||||
|
|
||||||
LINES_PERCENT=$((1000*$LINES_TESTED/$LINES_TOTAL))
|
|
||||||
LINES_PERCENT="$(($LINES_PERCENT/10)).$(($LINES_PERCENT-($LINES_PERCENT/10)*10))"
|
|
||||||
|
|
||||||
FUNCS_PERCENT=$((1000*$FUNCS_TESTED/$FUNCS_TOTAL))
|
|
||||||
FUNCS_PERCENT="$(($FUNCS_PERCENT/10)).$(($FUNCS_PERCENT-($FUNCS_PERCENT/10)*10))"
|
|
||||||
|
|
||||||
BRANCHES_PERCENT=$((1000*$BRANCHES_TESTED/$BRANCHES_TOTAL))
|
|
||||||
BRANCHES_PERCENT="$(($BRANCHES_PERCENT/10)).$(($BRANCHES_PERCENT-($BRANCHES_PERCENT/10)*10))"
|
|
||||||
|
|
||||||
rm unit-test-$TEST_OUTPUT
|
rm unit-test-$TEST_OUTPUT
|
||||||
rm sys-test-$TEST_OUTPUT
|
rm sys-test-$TEST_OUTPUT
|
||||||
rm compat-test-$TEST_OUTPUT
|
rm compat-test-$TEST_OUTPUT
|
||||||
rm cov-$TEST_OUTPUT
|
rm cov-$TEST_OUTPUT
|
||||||
|
|
||||||
echo "Lines Tested : $LINES_TESTED of $LINES_TOTAL $LINES_PERCENT%"
|
|
||||||
echo "Functions Tested : $FUNCS_TESTED of $FUNCS_TOTAL $FUNCS_PERCENT%"
|
|
||||||
echo "Branches Tested : $BRANCHES_TESTED of $BRANCHES_TOTAL $BRANCHES_PERCENT%"
|
|
||||||
echo
|
|
||||||
|
|
||||||
# Mark the report generation as having succeeded. This must be the
|
# Mark the report generation as having succeeded. This must be the
|
||||||
# last thing in the report generation.
|
# last thing in the report generation.
|
||||||
touch "basic-build-test-$$.ok"
|
touch "basic-build-test-$$.ok"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user