Skip to content

Commit

Permalink
adding some debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ximaz committed May 5, 2024
1 parent 5ebbf47 commit 77e1050
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions valgrind.bash
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ parse_valgrind_reports() {
kind="warning"
fi
while IFS= read -r line; do
echo "Parsing line: \"${line}\""
if [[ "${error}" != "" ]]; then
if [[ $(echo "${line}" | grep '^==.*== $') && $(skip_criterion_pipe_leaks "${error}") == "1" ]]; then
echo "::${kind} title=Valgrind Report '${INPUT_BINARY_PATH}' (${report_id})::${error}"
Expand All @@ -75,20 +74,21 @@ parse_valgrind_reports() {
done
done < "${VALGRIND_REPORTS}"
rm -f "${VALGRIND_REPORTS}"
[[ "${kind}" == "warning" ]] && exit 0 || exit "${status}"
[[ "${kind}" == "warning" ]] && echo "0" || echo "${status}"
}

main() {
local VALGRIND_REPORTS="valgrind-reports.log"
local VALGRIND_FLAGS=$(prepare_valgrind_flags)
local status=0

if [[ "${INPUT_LD_LIBRARY_PATH}" != "" ]]; then
export LD_LIBRARY_PATH="${INPUT_LD_LIBRARY_PATH}"
fi
echo "Starting Valgrind"
valgrind $VALGRIND_FLAGS "${INPUT_BINARY_PATH}" $INPUT_BINARY_ARGS 2>"${VALGRIND_REPORTS}"
echo "Parsing report"
parse_valgrind_reports "${VALGRIND_REPORTS}"
status=$(parse_valgrind_reports "${VALGRIND_REPORTS}")
echo "Exit status: ${status}"
exit "${status}"
}

main

0 comments on commit 77e1050

Please sign in to comment.