Fix regex bug in clang-tidy.

Also make tests slightly less dependent on default flags. Once we have
implemented configuration file support, we might want to store the
clang-tidy configuration for the tests there.

llvm-svn: 205408
This commit is contained in:
Daniel Jasper 2014-04-02 08:52:06 +00:00
parent a3b8f0cf7d
commit 7b8d263998
9 changed files with 11 additions and 11 deletions

View File

@ -37,7 +37,7 @@ static cl::opt<std::string> DisableChecks(
cl::init("(clang-analyzer-alpha.*" // To many false positives.
"|llvm-include-order" // Not implemented yet.
"|llvm-namespace-comment" // Not complete.
"|google-.*"), // Doesn't apply to LLVM.
"|google-.*)"), // Doesn't apply to LLVM.
cl::cat(ClangTidyCategory));
static cl::opt<bool> Fix("fix", cl::desc("Fix detected errors if possible."),
cl::init(false), cl::cat(ClangTidyCategory));

View File

@ -1,5 +1,5 @@
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
// RUN: clang-tidy %t.cpp -- > %t2.cpp
// RUN: clang-tidy %t.cpp -checks='llvm-namespace-comment' -disable-checks='' -- > %t2.cpp
// RUN: FileCheck -input-file=%t2.cpp %s
namespace i {

View File

@ -1,4 +1,4 @@
// RUN: clang-tidy -checks=google-explicit-constructor %s -- | FileCheck %s
// RUN: clang-tidy -checks=google-explicit-constructor -disable-checks='' %s -- | FileCheck %s
template<typename T>
class A { A(T); };

View File

@ -1,6 +1,6 @@
// RUN: clang-tidy %s.nonexistent.cpp -- | FileCheck -check-prefix=CHECK1 %s
// RUN: clang-tidy %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK2 %s
// RUN: clang-tidy -checks='^(google-|clang-diagnostic-literal-conversion)' %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK3 %s
// RUN: clang-tidy -disable-checks='' %s.nonexistent.cpp -- | FileCheck -check-prefix=CHECK1 %s
// RUN: clang-tidy -disable-checks='' %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK2 %s
// RUN: clang-tidy -checks='(google-explicit-constructor|clang-diagnostic-literal-conversion)' -disable-checks='' %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK3 %s
// CHECK1-NOT: warning
// CHECK2-NOT: warning

View File

@ -1,5 +1,5 @@
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
// RUN: clang-tidy %t.cpp -fix -- > %t.msg 2>&1
// RUN: clang-tidy %t.cpp -checks='(google-explicit-constructor|llvm-namespace-comment)' -disable-checks='' -fix -- > %t.msg 2>&1
// RUN: FileCheck -input-file=%t.cpp %s
// RUN: FileCheck -input-file=%t.msg -check-prefix=CHECK-MESSAGES %s

View File

@ -1,4 +1,4 @@
// RUN: clang-tidy -checks=google-explicit-constructor %s -- | FileCheck %s
// RUN: clang-tidy -checks=google-explicit-constructor -disable-checks='' %s -- | FileCheck %s
#define Q(name) class name { name(int i); }

View File

@ -1,4 +1,4 @@
// RUN: clang-tidy -checks=google-explicit-constructor %s -- | FileCheck %s
// RUN: clang-tidy -checks=google-explicit-constructor -disable-checks='' %s -- | FileCheck %s
class A { A(int i); };
// CHECK: :[[@LINE-1]]:11: warning: Single-argument constructors must be explicit [google-explicit-constructor]

View File

@ -1,5 +1,5 @@
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
// RUN: clang-tidy %t.cpp -fix -checks=^llvm-.* --
// RUN: clang-tidy %t.cpp -fix -checks=^llvm-.* -disable-checks='' --
// RUN: FileCheck -input-file=%t.cpp %s
namespace i {

View File

@ -1,4 +1,4 @@
// RUN: clang-tidy %s -checks='clang-analyzer-' -- | FileCheck %s
// RUN: clang-tidy %s -checks='clang-analyzer-.*' -- | FileCheck %s
extern void *malloc(unsigned long);
extern void free(void *);