Hi klimek,

This patch depends on D5501.
Check user name substitution more specifically by specifying it via the new
-config= option.
This also lets clang-tidy tests specify clang-tidy options before the '--'
when using check_clang_tidy_fix.sh.

http://reviews.llvm.org/D5502

Files:
  test/clang-tidy/avoid-c-style-casts.c
  test/clang-tidy/check_clang_tidy_fix.sh
  test/clang-tidy/google-readability-todo.cpp
  test/clang-tidy/llvm-include-order.cpp
Index: test/clang-tidy/avoid-c-style-casts.c
===================================================================
--- test/clang-tidy/avoid-c-style-casts.c
+++ 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) {
Index: test/clang-tidy/check_clang_tidy_fix.sh
===================================================================
--- test/clang-tidy/check_clang_tidy_fix.sh
+++ 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 @@
 # 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
Index: test/clang-tidy/google-readability-todo.cpp
===================================================================
--- test/clang-tidy/google-readability-todo.cpp
+++ 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
 
Index: test/clang-tidy/llvm-include-order.cpp
===================================================================
--- test/clang-tidy/llvm-include-order.cpp
+++ 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.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to