Committed obvious unrelated changes separately.
http://reviews.llvm.org/D5989
Files:
test/clang-tidy/arg-comments.cpp
test/clang-tidy/check_clang_tidy.sh
test/clang-tidy/check_clang_tidy_fix.sh
test/clang-tidy/google-explicit-make-pair.cpp
test/clang-tidy/google-member-string-references.cpp
test/clang-tidy/google-memset-zero-length.cpp
test/clang-tidy/google-overloaded-unary-and.cpp
test/clang-tidy/google-readability-casting.c
test/clang-tidy/google-readability-casting.cpp
test/clang-tidy/google-readability-function.cpp
test/clang-tidy/google-readability-namespace-comments.cpp
test/clang-tidy/google-readability-todo.cpp
test/clang-tidy/google-runtime-int.cpp
test/clang-tidy/llvm-include-order.cpp
test/clang-tidy/llvm-twine-local.cpp
test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp
test/clang-tidy/misc-swapped-arguments.cpp
test/clang-tidy/misc-undelegated-constructor.cpp
test/clang-tidy/misc-unused-raii.cpp
test/clang-tidy/misc-use-override.cpp
test/clang-tidy/readability-braces-around-statements-few-lines.cpp
test/clang-tidy/readability-braces-around-statements-same-line.cpp
test/clang-tidy/readability-braces-around-statements-single-line.cpp
test/clang-tidy/readability-braces-around-statements.cpp
test/clang-tidy/readability-function-size.cpp
test/clang-tidy/readability-redundant-smartptr-get.cpp
Index: test/clang-tidy/arg-comments.cpp
===================================================================
--- test/clang-tidy/arg-comments.cpp
+++ test/clang-tidy/arg-comments.cpp
@@ -1,16 +1,17 @@
-// 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.
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 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'
}
Index: test/clang-tidy/check_clang_tidy.sh
===================================================================
--- test/clang-tidy/check_clang_tidy.sh
+++ test/clang-tidy/check_clang_tidy.sh
@@ -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 @@
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
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
@@ -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
Index: test/clang-tidy/google-explicit-make-pair.cpp
===================================================================
--- test/clang-tidy/google-explicit-make-pair.cpp
+++ test/clang-tidy/google-explicit-make-pair.cpp
@@ -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 {
Index: test/clang-tidy/google-member-string-references.cpp
===================================================================
--- test/clang-tidy/google-member-string-references.cpp
+++ test/clang-tidy/google-member-string-references.cpp
@@ -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 @@
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 @@
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 {
Index: test/clang-tidy/google-memset-zero-length.cpp
===================================================================
--- test/clang-tidy/google-memset-zero-length.cpp
+++ test/clang-tidy/google-memset-zero-length.cpp
@@ -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__);
Index: test/clang-tidy/google-overloaded-unary-and.cpp
===================================================================
--- test/clang-tidy/google-overloaded-unary-and.cpp
+++ test/clang-tidy/google-overloaded-unary-and.cpp
@@ -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);
Index: test/clang-tidy/google-readability-casting.c
===================================================================
--- test/clang-tidy/google-readability-casting.c
+++ test/clang-tidy/google-readability-casting.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.sh %s google-readability-casting %t -- -x c
// REQUIRES: shell
void f(const char *cpc) {
Index: test/clang-tidy/google-readability-casting.cpp
===================================================================
--- test/clang-tidy/google-readability-casting.cpp
+++ test/clang-tidy/google-readability-casting.cpp
@@ -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; }
Index: test/clang-tidy/google-readability-function.cpp
===================================================================
--- test/clang-tidy/google-readability-function.cpp
+++ test/clang-tidy/google-readability-function.cpp
@@ -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 *) { /* */ }
Index: test/clang-tidy/google-readability-namespace-comments.cpp
===================================================================
--- test/clang-tidy/google-readability-namespace-comments.cpp
+++ test/clang-tidy/google-readability-namespace-comments.cpp
@@ -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]
Index: test/clang-tidy/google-readability-todo.cpp
===================================================================
--- test/clang-tidy/google-readability-todo.cpp
+++ test/clang-tidy/google-readability-todo.cpp
@@ -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
Index: test/clang-tidy/google-runtime-int.cpp
===================================================================
--- test/clang-tidy/google-runtime-int.cpp
+++ test/clang-tidy/google-runtime-int.cpp
@@ -1,59 +1,60 @@
-// 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() {
T i;
}
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'
}
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.sh %s llvm-include-order %t -- -isystem %S/Inputs/Headers
// REQUIRES: shell
// FIXME: Investigating.
Index: test/clang-tidy/llvm-twine-local.cpp
===================================================================
--- test/clang-tidy/llvm-twine-local.cpp
+++ test/clang-tidy/llvm-twine-local.cpp
@@ -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 {
Index: test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp
===================================================================
--- test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp
+++ test/clang-tidy/misc-bool-pointer-implicit-conversion.cpp
@@ -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();
Index: test/clang-tidy/misc-swapped-arguments.cpp
===================================================================
--- test/clang-tidy/misc-swapped-arguments.cpp
+++ test/clang-tidy/misc-swapped-arguments.cpp
@@ -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);
Index: test/clang-tidy/misc-undelegated-constructor.cpp
===================================================================
--- test/clang-tidy/misc-undelegated-constructor.cpp
+++ test/clang-tidy/misc-undelegated-constructor.cpp
@@ -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 @@
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,19 +32,19 @@
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();
};
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>
Index: test/clang-tidy/misc-unused-raii.cpp
===================================================================
--- test/clang-tidy/misc-unused-raii.cpp
+++ test/clang-tidy/misc-unused-raii.cpp
@@ -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 {
Index: test/clang-tidy/misc-use-override.cpp
===================================================================
--- test/clang-tidy/misc-use-override.cpp
+++ test/clang-tidy/misc-use-override.cpp
@@ -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
Index: test/clang-tidy/readability-braces-around-statements-few-lines.cpp
===================================================================
--- test/clang-tidy/readability-braces-around-statements-few-lines.cpp
+++ test/clang-tidy/readability-braces-around-statements-few-lines.cpp
@@ -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 *) {}
Index: test/clang-tidy/readability-braces-around-statements-same-line.cpp
===================================================================
--- test/clang-tidy/readability-braces-around-statements-same-line.cpp
+++ test/clang-tidy/readability-braces-around-statements-same-line.cpp
@@ -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 *) {}
Index: test/clang-tidy/readability-braces-around-statements-single-line.cpp
===================================================================
--- test/clang-tidy/readability-braces-around-statements-single-line.cpp
+++ test/clang-tidy/readability-braces-around-statements-single-line.cpp
@@ -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 *) {}
Index: test/clang-tidy/readability-braces-around-statements.cpp
===================================================================
--- test/clang-tidy/readability-braces-around-statements.cpp
+++ test/clang-tidy/readability-braces-around-statements.cpp
@@ -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 *) {}
Index: test/clang-tidy/readability-function-size.cpp
===================================================================
--- test/clang-tidy/readability-function-size.cpp
+++ test/clang-tidy/readability-function-size.cpp
@@ -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)
Index: test/clang-tidy/readability-redundant-smartptr-get.cpp
===================================================================
--- test/clang-tidy/readability-redundant-smartptr-get.cpp
+++ test/clang-tidy/readability-redundant-smartptr-get.cpp
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits