dist/tools/doccheck: only exit after when every check ran

Doxygen takes an eternity to finish anyways, so it does not hurt to not
early exit for the group checks.
This commit is contained in:
Martine Lenders 2020-12-15 17:10:22 +01:00
parent 787c2debae
commit db81377af7
No known key found for this signature in database
GPG Key ID: CCD317364F63286F

View File

@ -22,17 +22,19 @@ fi
DOXY_OUTPUT=$(make -C "${RIOTBASE}" doc 2>&1) DOXY_OUTPUT=$(make -C "${RIOTBASE}" doc 2>&1)
DOXY_ERRCODE=$? DOXY_ERRCODE=$?
RESULT=0
if [ "${DOXY_ERRCODE}" -ne 0 ] ; then if [ "${DOXY_ERRCODE}" -ne 0 ] ; then
echo "'make doc' exited with non-zero code (${DOXY_ERRCODE})" echo "'make doc' exited with non-zero code (${DOXY_ERRCODE})"
echo "${DOXY_OUTPUT}" echo "${DOXY_OUTPUT}"
exit 2 RESULT=2
else else
ERRORS=$(echo "${DOXY_OUTPUT}" | grep '.*warning' | sed "s#${PWD}/\([^:]*\)#\1#g") ERRORS=$(echo "${DOXY_OUTPUT}" | grep '.*warning' | sed "s#${PWD}/\([^:]*\)#\1#g")
if [ -n "${ERRORS}" ] ; then if [ -n "${ERRORS}" ] ; then
echo -e "${CERROR}ERROR: Doxygen generates the following warnings:${CRESET}" echo -e "${CERROR}ERROR: Doxygen generates the following warnings:${CRESET}"
echo "${ERRORS}" echo "${ERRORS}"
exit 2 RESULT=2
fi fi
fi fi
@ -62,7 +64,7 @@ UNDEFINED_GROUPS=$( \
if [ -n "${UNDEFINED_GROUPS}" ] if [ -n "${UNDEFINED_GROUPS}" ]
then then
COUNT=$(echo "${UNDEFINED_GROUPS}" | wc -l) COUNT=$(echo "${UNDEFINED_GROUPS}" | wc -l)
echo -ne "${CERROR}ERROR${CRESET} " echo -ne "\n\n${CERROR}ERROR${CRESET} "
echo -e "There are ${CWARN}${COUNT}${CRESET} undefined Doxygen groups:" echo -e "There are ${CWARN}${COUNT}${CRESET} undefined Doxygen groups:"
for group in ${UNDEFINED_GROUPS}; for group in ${UNDEFINED_GROUPS};
do do
@ -70,7 +72,7 @@ then
echo "${ALL_RAW_INGROUP}" | grep "\<${group}\>$" | sort -u | echo "${ALL_RAW_INGROUP}" | grep "\<${group}\>$" | sort -u |
awk -F: '{ print "\t" $1 }'; awk -F: '{ print "\t" $1 }';
done done
exit 2 RESULT=2
fi fi
# Check for groups defined multiple times: # Check for groups defined multiple times:
@ -79,7 +81,7 @@ MULTIPLE_DEFINED_GROUPS=$(echo "${DEFINED_GROUPS}" | uniq -d)
if [ -n "${MULTIPLE_DEFINED_GROUPS}" ] if [ -n "${MULTIPLE_DEFINED_GROUPS}" ]
then then
COUNT=$(echo "${MULTIPLE_DEFINED_GROUPS}" | wc -l) COUNT=$(echo "${MULTIPLE_DEFINED_GROUPS}" | wc -l)
echo -ne "${CERROR}ERROR${CRESET} " echo -ne "\n\n${CERROR}ERROR${CRESET} "
echo -e "There are ${CWARN}${COUNT}${CRESET} Doxygen groups defined multiple times:" echo -e "There are ${CWARN}${COUNT}${CRESET} Doxygen groups defined multiple times:"
for group in ${MULTIPLE_DEFINED_GROUPS}; for group in ${MULTIPLE_DEFINED_GROUPS};
do do
@ -89,5 +91,6 @@ then
grep "\<${group}\>$" | sort -u | grep "\<${group}\>$" | sort -u |
awk -F: '{ print "\t" $1 }'; awk -F: '{ print "\t" $1 }';
done done
exit 2 RESULT=2
fi fi
exit ${RESULT}