[clang-tools-extra] r213739 - check_clang_tidy_fix.sh: Fail immediately if clang-tidy crashes.

Nico Weber thakis at chromium.org
Wed Jul 23 08:45:45 PDT 2014


Does `set -e` at the top do the job as well? Then you wouldn't need the two
`|| exit $?`s. (I think sed doesn't set an error code if it can't find
matches.)


On Wed, Jul 23, 2014 at 4:49 AM, Benjamin Kramer <benny.kra at googlemail.com>
wrote:

> Author: d0k
> Date: Wed Jul 23 06:49:49 2014
> New Revision: 213739
>
> URL: http://llvm.org/viewvc/llvm-project?rev=213739&view=rev
> Log:
> check_clang_tidy_fix.sh: Fail immediately if clang-tidy crashes.
>
> Otherwise we'll get confusing messages from FileCheck instead of seeing
> the real issue.
>
> Modified:
>     clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh
>
> Modified: clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh?rev=213739&r1=213738&r2=213739&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh
> (original)
> +++ clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh Wed
> Jul 23 06:49:49 2014
> @@ -12,7 +12,7 @@ TEMPORARY_FILE=$3.cpp
>  sed 's#// *[A-Z-]\+:.*#//#' ${INPUT_FILE} > ${TEMPORARY_FILE}
>
>  clang-tidy ${TEMPORARY_FILE} -fix --checks="-*,${CHECK_TO_RUN}" --
> --std=c++11 \
> -  > ${TEMPORARY_FILE}.msg 2>&1
> +  > ${TEMPORARY_FILE}.msg 2>&1 || exit $?
>
>  FileCheck -input-file=${TEMPORARY_FILE} ${INPUT_FILE} \
>    -check-prefix=CHECK-FIXES -strict-whitespace || exit $?
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140723/764d8789/attachment.html>


More information about the cfe-commits mailing list