diff --git a/clang-tools-extra/test/clang-tidy/avoid-c-style-casts.c b/clang-tools-extra/test/clang-tidy/avoid-c-style-casts.c index 2bdad179a739..87d1dfcdf427 100644 --- a/clang-tools-extra/test/clang-tidy/avoid-c-style-casts.c +++ b/clang-tools-extra/test/clang-tidy/avoid-c-style-casts.c @@ -1,4 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-casting %t -x c +// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-casting %t -- -x c // REQUIRES: shell void f(const char *cpc) { diff --git a/clang-tools-extra/test/clang-tidy/check_clang_tidy_fix.sh b/clang-tools-extra/test/clang-tidy/check_clang_tidy_fix.sh index dc9a5bb3451b..a3e272045cba 100755 --- a/clang-tools-extra/test/clang-tidy/check_clang_tidy_fix.sh +++ b/clang-tools-extra/test/clang-tidy/check_clang_tidy_fix.sh @@ -6,17 +6,17 @@ # [optional compiler arguments] # # Example: -# // RUN: $(dirname %s)/check_clang_tidy_fix.sh %s llvm-include-order %t -isystem $(dirname %s)/Inputs/Headers +# // RUN: $(dirname %s)/check_clang_tidy_fix.sh %s llvm-include-order %t -- -isystem $(dirname %s)/Inputs/Headers # // REQUIRES: shell INPUT_FILE=$1 CHECK_TO_RUN=$2 TEMPORARY_FILE=$3.cpp -# Feed the rest arguments to clang-tidy after --. +# Feed the rest arguments to clang-tidy. shift 3 -CLANG_TIDY_ARGS=--std=c++11 -if [ "$#" -gt 0 ] ; then - CLANG_TIDY_ARGS=$* +if [ "$#" -eq 0 ] ; then + # Default to -- --std=c++11 + set - -- --std=c++11 fi set -o errexit @@ -26,8 +26,8 @@ set -o errexit # lines which could potentially trigger formatting-related checks. sed 's#// *CHECK-[A-Z-]*:.*#//#' ${INPUT_FILE} > ${TEMPORARY_FILE} -clang-tidy ${TEMPORARY_FILE} -fix --checks="-*,${CHECK_TO_RUN}" \ - -- ${CLANG_TIDY_ARGS} > ${TEMPORARY_FILE}.msg 2>&1 +clang-tidy ${TEMPORARY_FILE} -fix --checks="-*,${CHECK_TO_RUN}" "$@" \ + > ${TEMPORARY_FILE}.msg 2>&1 FileCheck -input-file=${TEMPORARY_FILE} ${INPUT_FILE} \ -check-prefix=CHECK-FIXES -strict-whitespace diff --git a/clang-tools-extra/test/clang-tidy/google-readability-todo.cpp b/clang-tools-extra/test/clang-tidy/google-readability-todo.cpp index efd85dc4a945..957c6e600848 100644 --- a/clang-tools-extra/test/clang-tidy/google-readability-todo.cpp +++ b/clang-tools-extra/test/clang-tidy/google-readability-todo.cpp @@ -1,21 +1,21 @@ -// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-todo %t +// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-todo %t -config="{User: 'some user'}" -- // REQUIRES: shell // TODOfix this1 // CHECK-MESSAGES: [[@LINE-1]]:1: warning: missing username/bug in TODO -// CHECK-FIXES: // TODO({{[^)]+}}): fix this1 +// CHECK-FIXES: // TODO(some user): fix this1 // TODO fix this2 // CHECK-MESSAGES: [[@LINE-1]]:1: warning: missing username/bug in TODO -// CHECK-FIXES: // TODO({{[^)]+}}): fix this2 +// CHECK-FIXES: // TODO(some user): fix this2 // TODO fix this3 // CHECK-MESSAGES: [[@LINE-1]]:1: warning: missing username/bug in TODO -// CHECK-FIXES: // TODO({{[^)]+}}): fix this3 +// CHECK-FIXES: // TODO(some user): fix this3 // TODO: fix this4 // CHECK-MESSAGES: [[@LINE-1]]:1: warning: missing username/bug in TODO -// CHECK-FIXES: // TODO({{[^)]+}}): fix this4 +// CHECK-FIXES: // TODO(some user): fix this4 // TODO(clang)fix this5 diff --git a/clang-tools-extra/test/clang-tidy/llvm-include-order.cpp b/clang-tools-extra/test/clang-tidy/llvm-include-order.cpp index ea1f8d764873..4568cb72c4ca 100644 --- a/clang-tools-extra/test/clang-tidy/llvm-include-order.cpp +++ b/clang-tools-extra/test/clang-tidy/llvm-include-order.cpp @@ -1,4 +1,4 @@ -// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s llvm-include-order %t -isystem %S/Inputs/Headers +// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s llvm-include-order %t -- -isystem %S/Inputs/Headers // REQUIRES: shell // FIXME: Investigating.