mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
infra: Improve valgrind result analysis syntax
Previously, if "definitely lost:" was included, it was always decided an error. Therefore, I modified it to recognize the size and number of errors.
This commit is contained in:
parent
a72ed0ddfa
commit
e07824d577
1 changed files with 3 additions and 1 deletions
4
.github/workflows/memcheck_valgrind.sh
vendored
4
.github/workflows/memcheck_valgrind.sh
vendored
|
@ -20,7 +20,9 @@ if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
|
||||||
echo "MEMCHECK errors:"
|
echo "MEMCHECK errors:"
|
||||||
echo $PAYLOAD_MEMCHECK
|
echo $PAYLOAD_MEMCHECK
|
||||||
|
|
||||||
if [[ $PAYLOAD_MEMCHECK == *"definitely lost:"* || $PAYLOAD_MEMCHECK == *"Invalid read "* || $PAYLOAD_MEMCHECK == *"Invalid write "* ]]; then
|
DEFINITELY_LOST_NUMBER=$(echo "$PAYLOAD_MEMCHECK" | grep -oP 'definitely lost:\s*\K[0-9]+(?=\s*bytes in)')
|
||||||
|
ERROR_NUMBER=$(echo "$PAYLOAD_MEMCHECK" | grep -oP 'ERROR SUMMARY:\s*\K[0-9]+(?=\s*errors)')
|
||||||
|
if [[ $ERROR_NUMBER != 0 || $DEFINITELY_LOST_NUMBER != 0 || $PAYLOAD_MEMCHECK == *"Invalid read "* || $PAYLOAD_MEMCHECK == *"Invalid write "* ]]; then
|
||||||
OUTPUT+=$'\n**MEMCHECK(VALGRIND) RESULT**:\n'
|
OUTPUT+=$'\n**MEMCHECK(VALGRIND) RESULT**:\n'
|
||||||
OUTPUT+=$'\n`valgrind --leak-check=yes ./tvgUnitTests`\n'
|
OUTPUT+=$'\n`valgrind --leak-check=yes ./tvgUnitTests`\n'
|
||||||
OUTPUT+=$'\n```\n'
|
OUTPUT+=$'\n```\n'
|
||||||
|
|
Loading…
Add table
Reference in a new issue