4 echo "valgrind --leak-check=yes ./tvgUnitTests"
7 valgrind --leak-check=yes ./tvgUnitTests > memcheck_valgrind.txt 2>&1
10 PAYLOAD_MEMCHECK=`cat memcheck_valgrind.txt`
11 COMMENTS_URL=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.comments_url)
14 echo "MEMCHECK errors:"
15 echo $PAYLOAD_MEMCHECK
17 if [[ $PAYLOAD_MEMCHECK == *"definitely lost:"* || $PAYLOAD_MEMCHECK == *"Invalid read "* || $PAYLOAD_MEMCHECK == *"Invalid write "* ]]; then
18 OUTPUT+=$'\n**MEMCHECK(VALGRIND) RESULT**:\n'
19 OUTPUT+=$'\n`valgrind --leak-check=yes ./tvgUnitTests`\n'
21 OUTPUT+="$PAYLOAD_MEMCHECK"
25 PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
27 curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"