[clang-tools-extra] r220634 - [clang-tidy] check_clang_tidy_fix.sh -> check_clang_tidy.sh

Alexander Kornienko alexfh at google.com
Sat Oct 25 19:58:08 PDT 2014


Author: alexfh
Date: Sat Oct 25 21:58:07 2014
New Revision: 220634

URL: http://llvm.org/viewvc/llvm-project?rev=220634&view=rev
Log:
[clang-tidy] check_clang_tidy_fix.sh -> check_clang_tidy.sh

Summary: Make the script suitable for checking just messages. Move most of the tests to use it. Clean up the tests: shorten messages, insert line numbers, remove unnecessary RUN: lines, etc.

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D5989

Added:
    clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.sh
      - copied, changed from r220633, clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh
Removed:
    clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh
Modified:
    clang-tools-extra/trunk/test/clang-tidy/arg-comments.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-explicit-make-pair.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-member-string-references.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-memset-zero-length.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-overloaded-unary-and.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.c
    clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-function.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-readability-todo.cpp
    clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp
    clang-tools-extra/trunk/test/clang-tidy/llvm-twine-local.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-swapped-arguments.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-undelegated-constructor.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp
    clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-few-lines.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-same-line.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-single-line.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-function-size.cpp
    clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get.cpp

Modified: clang-tools-extra/trunk/test/clang-tidy/arg-comments.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/arg-comments.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/arg-comments.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/arg-comments.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,5 @@
-// RUN: clang-tidy --checks='-*,misc-argument-comment' %s -- -std=c++11 | FileCheck %s -implicit-check-not='{{warning:|error:}}'
+// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-argument-comment %t
+// REQUIRES: shell
 
 // FIXME: clang-tidy should provide a -verify mode to make writing these checks
 // easier and more accurate.
@@ -7,10 +8,10 @@ void ffff(int xxxx, int yyyy);
 
 void f(int x, int y);
 void g() {
-  // CHECK: [[@LINE+4]]:5: warning: argument name 'y' in comment does not match parameter name 'x'
-  // CHECK: :[[@LINE-3]]:12: note: 'x' declared here
-  // CHECK: [[@LINE+2]]:14: warning: argument name 'z' in comment does not match parameter name 'y'
-  // CHECK: :[[@LINE-5]]:19: note: 'y' declared here
+  // CHECK-MESSAGES: [[@LINE+4]]:5: warning: argument name 'y' in comment does not match parameter name 'x'
+  // CHECK-MESSAGES: :[[@LINE-3]]:12: note: 'x' declared here
+  // CHECK-MESSAGES: [[@LINE+2]]:14: warning: argument name 'z' in comment does not match parameter name 'y'
+  // CHECK-MESSAGES: :[[@LINE-5]]:19: note: 'y' declared here
   f(/*y=*/0, /*z=*/0);
 }
 
@@ -36,5 +37,5 @@ void variadic2(int zzz, Args&&... args);
 void templates() {
   variadic(/*xxx=*/0, /*yyy=*/1);
   variadic2(/*zzZ=*/0, /*xxx=*/1, /*yyy=*/2);
-  // CHECK: [[@LINE-1]]:13: warning: argument name 'zzZ' in comment does not match parameter name 'zzz'
+  // CHECK-MESSAGES: [[@LINE-1]]:13: warning: argument name 'zzZ' in comment does not match parameter name 'zzz'
 }

Copied: clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.sh (from r220633, 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.sh?p2=clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy.sh&p1=clang-tools-extra/trunk/test/clang-tidy/check_clang_tidy_fix.sh&r1=220633&r2=220634&rev=220634&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.sh Sat Oct 25 21:58:07 2014
@@ -1,12 +1,12 @@
 #!/bin/sh
 #
-# Run clang-tidy in fix mode and verify the result.
+# Run clang-tidy in fix mode and verify fixes, messages or both.
 # Usage:
-#   check_clang_tidy_fix.sh <source-file> <check-name> <temp-file> \
+#   check_clang_tidy.sh <source-file> <check-name> <temp-file> \
 #     [optional clang-tidy 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.sh %s llvm-include-order %t -- -isystem $(dirname %s)/Inputs/Headers
 #   // REQUIRES: shell
 
 INPUT_FILE=$1
@@ -21,18 +21,25 @@ fi
 
 set -o errexit
 
+if ! grep -q 'CHECK-FIXES\|CHECK-MESSAGES' "${INPUT_FILE}"; then
+  echo "FAIL: Neither CHECK-FIXES nor CHECK-MESSAGES found in the input"
+  exit 1
+fi
+
 # Remove the contents of the CHECK lines to avoid CHECKs matching on themselves.
 # We need to keep the comments to preserve line numbers while avoiding empty
 # lines which could potentially trigger formatting-related checks.
-sed 's#// *CHECK-[A-Z-]*:.*#//#' ${INPUT_FILE} > ${TEMPORARY_FILE}
+sed 's#// *CHECK-[A-Z-]*:.*#//#' "${INPUT_FILE}" > "${TEMPORARY_FILE}"
 
-clang-tidy ${TEMPORARY_FILE} -fix --checks="-*,${CHECK_TO_RUN}" "$@" \
-  > ${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
+if grep -q 'CHECK-FIXES' "${INPUT_FILE}"; then
+  FileCheck -input-file="${TEMPORARY_FILE}" "${INPUT_FILE}" \
+    -check-prefix=CHECK-FIXES -strict-whitespace
+fi
 
-if grep -q CHECK-MESSAGES ${INPUT_FILE}; then
-  FileCheck -input-file=${TEMPORARY_FILE}.msg ${INPUT_FILE} \
-    -check-prefix=CHECK-MESSAGES -implicit-check-not="{{warning|error}}:"
+if grep -q 'CHECK-MESSAGES' "${INPUT_FILE}"; then
+  FileCheck -input-file="${TEMPORARY_FILE}.msg" "${INPUT_FILE}" \
+    -check-prefix=CHECK-MESSAGES -implicit-check-not='{{warning|error}}:'
 fi

Removed: 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=220633&view=auto
==============================================================================
--- 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 (removed)
@@ -1,38 +0,0 @@
-#!/bin/sh
-#
-# Run clang-tidy in fix mode and verify the result.
-# Usage:
-#   check_clang_tidy_fix.sh <source-file> <check-name> <temp-file> \
-#     [optional clang-tidy arguments]
-#
-# Example:
-#   // 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.
-shift 3
-if [ "$#" -eq 0 ] ; then
-  # Default to -- --std=c++11
-  set - -- --std=c++11
-fi
-
-set -o errexit
-
-# Remove the contents of the CHECK lines to avoid CHECKs matching on themselves.
-# We need to keep the comments to preserve line numbers while avoiding empty
-# 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}" "$@" \
-  > ${TEMPORARY_FILE}.msg 2>&1
-
-FileCheck -input-file=${TEMPORARY_FILE} ${INPUT_FILE} \
-  -check-prefix=CHECK-FIXES -strict-whitespace
-
-if grep -q CHECK-MESSAGES ${INPUT_FILE}; then
-  FileCheck -input-file=${TEMPORARY_FILE}.msg ${INPUT_FILE} \
-    -check-prefix=CHECK-MESSAGES -implicit-check-not="{{warning|error}}:"
-fi

Modified: clang-tools-extra/trunk/test/clang-tidy/google-explicit-make-pair.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-explicit-make-pair.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-explicit-make-pair.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-explicit-make-pair.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-build-explicit-make-pair %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-build-explicit-make-pair %t
 // REQUIRES: shell
 
 namespace std {

Modified: clang-tools-extra/trunk/test/clang-tidy/google-member-string-references.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-member-string-references.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-member-string-references.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-member-string-references.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,5 @@
-// RUN: clang-tidy %s -checks='-*,google-runtime-member-string-references' -- | FileCheck %s -implicit-check-not="{{warning|error}}:"
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-member-string-references %t
+// REQUIRES: shell
 
 namespace std {
 template<typename T>
@@ -12,7 +13,7 @@ class string {};
 
 struct A {
   const std::string &s;
-// CHECK: :[[@LINE-1]]:3: warning: const string& members are dangerous. It is much better to use alternatives, such as pointers or simple constants.
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: const string& members are dangerous. It is much better to use alternatives, such as pointers or simple constants. [google-runtime-member-string-references]
 };
 
 struct B {
@@ -28,14 +29,14 @@ struct D {
   D();
   const T &s;
   const std::string &s2;
-// CHECK: :[[@LINE-1]]:3: warning: const string& members are dangerous. It is much better to use alternatives, such as pointers or simple constants.
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: const string& members are dangerous.
 };
 
 D<std::string> d;
 
 struct AA {
   const string &s;
-// CHECK: :[[@LINE-1]]:3: warning: const string& members are dangerous. It is much better to use alternatives, such as pointers or simple constants.
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: const string& members are dangerous.
 };
 
 struct BB {

Modified: clang-tools-extra/trunk/test/clang-tidy/google-memset-zero-length.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-memset-zero-length.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-memset-zero-length.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-memset-zero-length.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-runtime-memset %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-memset %t
 // REQUIRES: shell
 
 void *memset(void *, int, __SIZE_TYPE__);

Modified: clang-tools-extra/trunk/test/clang-tidy/google-overloaded-unary-and.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-overloaded-unary-and.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-overloaded-unary-and.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-overloaded-unary-and.cpp Sat Oct 25 21:58:07 2014
@@ -1,24 +1,26 @@
-// RUN: clang-tidy %s -checks='-*,google-runtime-operator' -- | FileCheck %s -implicit-check-not="{{warning|error}}:"
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-operator %t
+// REQUIRES: shell
 
 struct Foo {
   void *operator&();
-// CHECK: :[[@LINE-1]]:3: warning: do not overload unary operator&, it is dangerous.
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not overload unary operator&, it is dangerous. [google-runtime-operator]
 };
 
 template <typename T>
 struct TFoo {
   T *operator&();
-// CHECK: :[[@LINE-1]]:3: warning: do not overload unary operator&, it is dangerous.
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not overload unary operator&
 };
 
 TFoo<int> tfoo;
 
 struct Bar;
 void *operator&(Bar &b);
-// CHECK: :[[@LINE-1]]:1: warning: do not overload unary operator&, it is dangerous.
+// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: do not overload unary operator&
 
+// No warnings on binary operators.
 struct Qux {
-  void *operator&(Qux &q); // no-warning
+  void *operator&(Qux &q);
 };
 
-void *operator&(Qux &q, Qux &r); // no-warning
+void *operator&(Qux &q, Qux &r);

Modified: clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.c
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.c?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.c (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.c Sat Oct 25 21:58:07 2014
@@ -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.sh %s google-readability-casting %t -- -x c
 // REQUIRES: shell
 
 void f(const char *cpc) {

Modified: clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-readability-casting.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-casting %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-casting %t
 // REQUIRES: shell
 
 bool g() { return false; }

Modified: clang-tools-extra/trunk/test/clang-tidy/google-readability-function.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-readability-function.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-readability-function.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-readability-function.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-function %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-function %t
 // REQUIRES: shell
 
 void Method(char *) { /* */ }

Modified: clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-readability-namespace-comments.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-namespace-comments %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-namespace-comments %t
 // REQUIRES: shell
 
 // CHECK-MESSAGES: :[[@LINE+2]]:11: warning: namespace not terminated with a closing comment [google-readability-namespace-comments]

Modified: clang-tools-extra/trunk/test/clang-tidy/google-readability-todo.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-readability-todo.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-readability-todo.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-readability-todo.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s google-readability-todo %t -config="{User: 'some user'}" --
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-readability-todo %t -config="{User: 'some user'}" --
 // REQUIRES: shell
 
 //   TODOfix this1

Modified: clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/google-runtime-int.cpp Sat Oct 25 21:58:07 2014
@@ -1,13 +1,14 @@
-// RUN: clang-tidy -checks=-*,google-runtime-int %s -- -x c++ 2>&1 | FileCheck %s -implicit-check-not='{{warning:|error:}}'
+// RUN: $(dirname %s)/check_clang_tidy.sh %s google-runtime-int %t
+// REQUIRES: shell
 
 long a();
-// CHECK: [[@LINE-1]]:1: warning: consider replacing 'long' with 'int{{..}}'
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: consider replacing 'long' with 'int{{..}}'
 
 typedef unsigned long long uint64; // NOLINT
 
 long b(long = 1);
-// CHECK: [[@LINE-1]]:1: warning: consider replacing 'long' with 'int{{..}}'
-// CHECK: [[@LINE-2]]:8: warning: consider replacing 'long' with 'int{{..}}'
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: consider replacing 'long' with 'int{{..}}'
+// CHECK-MESSAGES: [[@LINE-2]]:8: warning: consider replacing 'long' with 'int{{..}}'
 
 template <typename T>
 void tmpl() {
@@ -15,45 +16,45 @@ void tmpl() {
 }
 
 short bar(const short, unsigned short) {
-// CHECK: [[@LINE-1]]:1: warning: consider replacing 'short' with 'int16'
-// CHECK: [[@LINE-2]]:17: warning: consider replacing 'short' with 'int16'
-// CHECK: [[@LINE-3]]:24: warning: consider replacing 'unsigned short' with 'uint16'
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: consider replacing 'short' with 'int16'
+// CHECK-MESSAGES: [[@LINE-2]]:17: warning: consider replacing 'short' with 'int16'
+// CHECK-MESSAGES: [[@LINE-3]]:24: warning: consider replacing 'unsigned short' with 'uint16'
   long double foo = 42;
   uint64 qux = 42;
   unsigned short port;
 
   const unsigned short bar = 0;
-// CHECK: [[@LINE-1]]:9: warning: consider replacing 'unsigned short' with 'uint16'
+// CHECK-MESSAGES: [[@LINE-1]]:9: warning: consider replacing 'unsigned short' with 'uint16'
   long long *baar;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'long long' with 'int64'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'long long' with 'int64'
   const unsigned short &bara = bar;
-// CHECK: [[@LINE-1]]:9: warning: consider replacing 'unsigned short' with 'uint16'
+// CHECK-MESSAGES: [[@LINE-1]]:9: warning: consider replacing 'unsigned short' with 'uint16'
   long const long moo = 1;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'long long' with 'int64'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'long long' with 'int64'
   long volatile long wat = 42;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'long long' with 'int64'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'long long' with 'int64'
   unsigned long y;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'unsigned long' with 'uint{{..}}'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'unsigned long' with 'uint{{..}}'
   unsigned long long **const *tmp;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'unsigned long long' with 'uint64'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'unsigned long long' with 'uint64'
   unsigned long long **const *&z = tmp;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'unsigned long long' with 'uint64'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'unsigned long long' with 'uint64'
   unsigned short porthole;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'unsigned short' with 'uint16'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'unsigned short' with 'uint16'
 
   uint64 cast = (short)42;
-// CHECK: [[@LINE-1]]:18: warning: consider replacing 'short' with 'int16'
+// CHECK-MESSAGES: [[@LINE-1]]:18: warning: consider replacing 'short' with 'int16'
 
 #define l long
   l x;
 
   tmpl<short>();
-// CHECK: [[@LINE-1]]:8: warning: consider replacing 'short' with 'int16'
+// CHECK-MESSAGES: [[@LINE-1]]:8: warning: consider replacing 'short' with 'int16'
 }
 
 void p(unsigned short port);
 
 void qux() {
   short port;
-// CHECK: [[@LINE-1]]:3: warning: consider replacing 'short' with 'int16'
+// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'short' with 'int16'
 }

Modified: clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/llvm-include-order.cpp Sat Oct 25 21:58:07 2014
@@ -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.sh %s llvm-include-order %t -- -isystem %S/Inputs/Headers
 // REQUIRES: shell
 
 // FIXME: Investigating.

Modified: clang-tools-extra/trunk/test/clang-tidy/llvm-twine-local.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/llvm-twine-local.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/llvm-twine-local.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/llvm-twine-local.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s llvm-twine-local %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s llvm-twine-local %t
 // REQUIRES: shell
 
 namespace llvm {

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-bool-pointer-implicit-conversion %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-bool-pointer-implicit-conversion %t
 // REQUIRES: shell
 
 bool *SomeFunction();

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-swapped-arguments.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-swapped-arguments.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-swapped-arguments.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-swapped-arguments.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-swapped-arguments %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-swapped-arguments %t
 // REQUIRES: shell
 
 void F(int, double);

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-undelegated-constructor.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-undelegated-constructor.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-undelegated-constructor.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-undelegated-constructor.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,5 @@
-// RUN: clang-tidy -checks='-*,misc-undelegated-constructor' %s -- -std=c++11 2>&1 | FileCheck %s -implicit-check-not='{{warning:|error:}}'
+// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-undelegated-constructor %t
+// REQUIRES: shell
 
 struct Ctor;
 Ctor foo();
@@ -9,18 +10,18 @@ struct Ctor {
   Ctor(int, int);
   Ctor(Ctor *i) {
     Ctor();
-// CHECK: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead [misc-undelegated-constructor]
     Ctor(0);
-// CHECK: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
     Ctor(1, 2);
-// CHECK: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
     foo();
   }
 };
 
 Ctor::Ctor() {
   Ctor(1);
-// CHECK: :[[@LINE-1]]:3: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: did you intend to call a delegated constructor?
 }
 
 Ctor::Ctor(int i) : Ctor(i, 1) {} // properly delegated.
@@ -31,11 +32,11 @@ struct Dtor {
   Dtor(int, int);
   Dtor(Ctor *i) {
     Dtor();
-// CHECK: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
     Dtor(0);
-// CHECK: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
     Dtor(1, 2);
-// CHECK: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: did you intend to call a delegated constructor?
   }
   ~Dtor();
 };
@@ -43,7 +44,7 @@ struct Dtor {
 struct Base {};
 struct Derived : public Base {
   Derived() { Base(); }
-// CHECK: :[[@LINE-1]]:15: warning: did you intend to call a delegated constructor? A temporary object is created here instead
+// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: did you intend to call a delegated constructor?
 };
 
 template <typename T>

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-unused-raii.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-unused-raii %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-unused-raii %t
 // REQUIRES: shell
 
 struct Foo {

Modified: clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/misc-use-override.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s misc-use-override %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s misc-use-override %t
 // REQUIRES: shell
 
 #define ABSTRACT = 0

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-few-lines.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-few-lines.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-few-lines.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-few-lines.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 4}]}" --
+// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 4}]}" --
 // REQUIRES: shell
 
 void do_something(const char *) {}

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-same-line.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-same-line.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-same-line.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-same-line.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 1}]}" --
+// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 1}]}" --
 // REQUIRES: shell
 
 void do_something(const char *) {}

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-single-line.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-single-line.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-single-line.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements-single-line.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 2}]}" --
+// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t -config="{CheckOptions: [{key: readability-braces-around-statements.ShortStatementLines, value: 2}]}" --
 // REQUIRES: shell
 
 void do_something(const char *) {}

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-braces-around-statements.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s readability-braces-around-statements %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-braces-around-statements %t
 // REQUIRES: shell
 
 void do_something(const char *) {}

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-function-size.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-function-size.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-function-size.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-function-size.cpp Sat Oct 25 21:58:07 2014
@@ -1,58 +1,55 @@
-// RUN: rm -rf %t
-// RUN: mkdir -p %t
-// RUN: sed 's#// *[A-Z-][A-Z-]*:.*#//#' %s > %t/t.cpp
-// RUN: echo '{ Checks: "-*,readability-function-size", CheckOptions: [{key: readability-function-size.LineThreshold, value: 0}, {key: readability-function-size.StatementThreshold, value: 0}, {key: readability-function-size.BranchThreshold, value: 0}]}' > %t/.clang-tidy
-// RUN: clang-tidy %t/t.cpp -- -std=c++11 2>&1 | FileCheck %s -implicit-check-not='{{warning:|error:|note:}}'
+// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-function-size %t -config='{CheckOptions: [{key: readability-function-size.LineThreshold, value: 0}, {key: readability-function-size.StatementThreshold, value: 0}, {key: readability-function-size.BranchThreshold, value: 0}]}' -- -std=c++11
+// REQUIRES: shell
 
 void foo1() {
 }
 
 void foo2() {;}
-// CHECK: warning: function 'foo2' exceeds recommended size/complexity thresholds
-// CHECK: note: 1 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'foo2' exceeds recommended size/complexity thresholds [readability-function-size]
+// CHECK-MESSAGES: :[[@LINE-2]]:6: note: 1 statements (threshold 0)
 
 void foo3() {
 ;
 
 }
-// CHECK: warning: function 'foo3' exceeds recommended size/complexity thresholds
-// CHECK: note: 3 lines including whitespace and comments (threshold 0)
-// CHECK: note: 1 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-4]]:6: warning: function 'foo3' exceeds recommended size/complexity
+// CHECK-MESSAGES: :[[@LINE-5]]:6: note: 3 lines including whitespace and comments (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-6]]:6: note: 1 statements (threshold 0)
 
 void foo4(int i) { if (i) {} else; {}
 }
-// CHECK: warning: function 'foo4' exceeds recommended size/complexity thresholds
-// CHECK: note: 1 lines including whitespace and comments (threshold 0)
-// CHECK: note: 3 statements (threshold 0)
-// CHECK: note: 1 branches (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-2]]:6: warning: function 'foo4' exceeds recommended size/complexity
+// CHECK-MESSAGES: :[[@LINE-3]]:6: note: 1 lines including whitespace and comments (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-4]]:6: note: 3 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-5]]:6: note: 1 branches (threshold 0)
 
 void foo5(int i) {for(;i;)while(i)
 do;while(i);
 }
-// CHECK: warning: function 'foo5' exceeds recommended size/complexity thresholds
-// CHECK: note: 2 lines including whitespace and comments (threshold 0)
-// CHECK: note: 7 statements (threshold 0)
-// CHECK: note: 3 branches (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-3]]:6: warning: function 'foo5' exceeds recommended size/complexity
+// CHECK-MESSAGES: :[[@LINE-4]]:6: note: 2 lines including whitespace and comments (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-5]]:6: note: 7 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-6]]:6: note: 3 branches (threshold 0)
 
 template <typename T> T foo6(T i) {return i;
 }
 int x = foo6(0);
-// CHECK: warning: function 'foo6' exceeds recommended size/complexity thresholds
-// CHECK: note: 1 lines including whitespace and comments (threshold 0)
-// CHECK: note: 1 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-3]]:25: warning: function 'foo6' exceeds recommended size/complexity
+// CHECK-MESSAGES: :[[@LINE-4]]:25: note: 1 lines including whitespace and comments (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-5]]:25: note: 1 statements (threshold 0)
 
 void bar1() { [](){;;;;;;;;;;;if(1){}}();
 
 
 }
-// CHECK: warning: function 'bar1' exceeds recommended size/complexity thresholds
-// CHECK: note: 3 lines including whitespace and comments (threshold 0)
-// CHECK: note: 14 statements (threshold 0)
-// CHECK: note: 1 branches (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-4]]:6: warning: function 'bar1' exceeds recommended size/complexity
+// CHECK-MESSAGES: :[[@LINE-5]]:6: note: 3 lines including whitespace and comments (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-6]]:6: note: 14 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-7]]:6: note: 1 branches (threshold 0)
 
 void bar2() { class A { void barx() {;;} }; }
-// CHECK: warning: function 'bar2' exceeds recommended size/complexity thresholds
-// CHECK: note: 3 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'bar2' exceeds recommended size/complexity
+// CHECK-MESSAGES: :[[@LINE-2]]:6: note: 3 statements (threshold 0)
 //
-// CHECK: warning: function 'barx' exceeds recommended size/complexity thresholds
-// CHECK: note: 2 statements (threshold 0)
+// CHECK-MESSAGES: :[[@LINE-4]]:30: warning: function 'barx' exceeds recommended size/complexity
+// CHECK-MESSAGES: :[[@LINE-5]]:30: note: 2 statements (threshold 0)

Modified: clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get.cpp?rev=220634&r1=220633&r2=220634&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-redundant-smartptr-get.cpp Sat Oct 25 21:58:07 2014
@@ -1,4 +1,4 @@
-// RUN: $(dirname %s)/check_clang_tidy_fix.sh %s readability-redundant-smartptr-get %t
+// RUN: $(dirname %s)/check_clang_tidy.sh %s readability-redundant-smartptr-get %t
 // REQUIRES: shell
 
 #define NULL __null





More information about the cfe-commits mailing list