mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 20:45:32 +00:00
tools/trivial: replace tabs from "tools/run-test-valgrind.sh" script
This commit is contained in:
parent
491aad08a9
commit
a54a3e8263
|
@ -91,9 +91,9 @@ if [ "$NMTST_LAUNCH_DBUS" == "yes" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$NMTST_NO_VALGRIND" != "" ]; then
|
if [ "$NMTST_NO_VALGRIND" != "" ]; then
|
||||||
"${NMTST_DBUS_RUN_SESSION[@]}" \
|
"${NMTST_DBUS_RUN_SESSION[@]}" \
|
||||||
"$TEST" "$@"
|
"$TEST" "$@"
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOGFILE="${TEST}.valgrind-log"
|
LOGFILE="${TEST}.valgrind-log"
|
||||||
|
@ -102,56 +102,56 @@ export G_SLICE=always-malloc
|
||||||
export G_DEBUG=gc-friendly
|
export G_DEBUG=gc-friendly
|
||||||
"${NMTST_DBUS_RUN_SESSION[@]}" \
|
"${NMTST_DBUS_RUN_SESSION[@]}" \
|
||||||
"${NMTST_LIBTOOL[@]}" "$NMTST_VALGRIND" \
|
"${NMTST_LIBTOOL[@]}" "$NMTST_VALGRIND" \
|
||||||
--quiet \
|
--quiet \
|
||||||
--error-exitcode=$VALGRIND_ERROR \
|
--error-exitcode=$VALGRIND_ERROR \
|
||||||
--leak-check=full \
|
--leak-check=full \
|
||||||
--gen-suppressions=all \
|
--gen-suppressions=all \
|
||||||
--suppressions="$SUPPRESSIONS" \
|
--suppressions="$SUPPRESSIONS" \
|
||||||
--num-callers=100 \
|
--num-callers=100 \
|
||||||
--log-file="$LOGFILE" \
|
--log-file="$LOGFILE" \
|
||||||
"$TEST" \
|
"$TEST" \
|
||||||
"$@"
|
"$@"
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
|
|
||||||
test -s "$LOGFILE"
|
test -s "$LOGFILE"
|
||||||
HAS_ERRORS=$?
|
HAS_ERRORS=$?
|
||||||
|
|
||||||
if [ $RESULT -ne 0 -a $RESULT -ne 77 ]; then
|
if [ $RESULT -ne 0 -a $RESULT -ne 77 ]; then
|
||||||
if [ $HAS_ERRORS -ne 0 ]; then
|
if [ $HAS_ERRORS -ne 0 ]; then
|
||||||
rm -f "$LOGFILE"
|
rm -f "$LOGFILE"
|
||||||
elif [ $RESULT -ne $VALGRIND_ERROR ]; then
|
elif [ $RESULT -ne $VALGRIND_ERROR ]; then
|
||||||
# the test (probably) didn't fail due to valgrind.
|
# the test (probably) didn't fail due to valgrind.
|
||||||
echo "The test failed. Also check the valgrind log at '`realpath "$LOGFILE"`'" >&2
|
echo "The test failed. Also check the valgrind log at '`realpath "$LOGFILE"`'" >&2
|
||||||
else
|
else
|
||||||
echo "valgrind failed! Check the log at '`realpath "$LOGFILE"`'" >&2
|
echo "valgrind failed! Check the log at '`realpath "$LOGFILE"`'" >&2
|
||||||
UNRESOLVED=$(awk -F: '/obj:\// {print $NF}' "$LOGFILE" | sort | uniq)
|
UNRESOLVED=$(awk -F: '/obj:\// {print $NF}' "$LOGFILE" | sort | uniq)
|
||||||
if [ -n "$UNRESOLVED" ]; then
|
if [ -n "$UNRESOLVED" ]; then
|
||||||
echo Some addresses could not be resolved into symbols. >&2
|
echo Some addresses could not be resolved into symbols. >&2
|
||||||
echo The errors might get suppressed when you install the debuging symbols. >&2
|
echo The errors might get suppressed when you install the debuging symbols. >&2
|
||||||
if [ -x /usr/bin/dnf ]; then
|
if [ -x /usr/bin/dnf ]; then
|
||||||
echo Hint: dnf debuginfo-install $UNRESOLVED >&2
|
echo Hint: dnf debuginfo-install $UNRESOLVED >&2
|
||||||
elif [ -x /usr/bin/debuginfo-install ]; then
|
elif [ -x /usr/bin/debuginfo-install ]; then
|
||||||
echo Hint: debuginfo-install $UNRESOLVED >&2
|
echo Hint: debuginfo-install $UNRESOLVED >&2
|
||||||
else
|
else
|
||||||
echo Files without debugging symbols: $UNRESOLVED >&2
|
echo Files without debugging symbols: $UNRESOLVED >&2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
exit $RESULT
|
exit $RESULT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $HAS_ERRORS -eq 0 ]; then
|
if [ $HAS_ERRORS -eq 0 ]; then
|
||||||
# valgrind doesn't support setns syscall and spams the logfile.
|
# valgrind doesn't support setns syscall and spams the logfile.
|
||||||
# hack around it...
|
# hack around it...
|
||||||
if [ "$(basename "$TEST")" = 'test-link-linux' -a -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then
|
if [ "$(basename "$TEST")" = 'test-link-linux' -a -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then
|
||||||
HAS_ERRORS=1
|
HAS_ERRORS=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $HAS_ERRORS -eq 0 ]; then
|
if [ $HAS_ERRORS -eq 0 ]; then
|
||||||
# shouldn't actually happen...
|
# shouldn't actually happen...
|
||||||
echo "valgrind succeeded, but log is not empty: '`realpath "$LOGFILE"`'" >&2
|
echo "valgrind succeeded, but log is not empty: '`realpath "$LOGFILE"`'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$LOGFILE"
|
rm -f "$LOGFILE"
|
||||||
|
|
Loading…
Reference in a new issue