Skip to content
Snippets Groups Projects
Commit 86da62d2 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

[check-iwyu] Do not fail right away if IWYU_TOOL fails

Since only newer versions of IWYU_TOOL fail with an exit code, we have
to disable -e around the IWYU_TOOL invocation. Otherwise we would not
print IWYU_LOG.
parent 38e09b7d
No related branches found
No related tags found
No related merge requests found
......@@ -64,10 +64,23 @@ else
echo "WARNING: ${IWYU_TOOL} does not support --load"
fi
set +e
${IWYU_TOOL} ${IWYU_TOOL_ARGS[@]} \
-- \
-Xiwyu --mapping_file="${MESON_SOURCE_ROOT}/iwyu-mappings.imp" \
> "${IWYU_LOG}"
set -e
# Only newer versions of IWYU_TOOL fail with an exit code (IWYU >
# 0.15, since commit
# https://github.com/include-what-you-use/include-what-you-use/commit/a7499e4a2b416592777cc4c33fca746d091af738). Therefore
# we have to manually see if this IWYU_TOOL run failed with an error
# exit code.
# shellcheck: disable=SC2181
if [[ ${?} -gt 0 ]]; then
echoerr "IWYU exited with ${?}"
cat "${IWYU_LOG}"
exit $?
fi
if [[ ! -s "${IWYU_LOG}" ]]; then
echoerr "${IWYU_LOG} is empty (or non existent)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment