[clang-tools-extra] r205408 - Fix regex bug in clang-tidy.
Daniel Jasper
djasper at google.com
Wed Apr 2 01:52:07 PDT 2014
Author: djasper
Date: Wed Apr 2 03:52:06 2014
New Revision: 205408
URL: http://llvm.org/viewvc/llvm-project?rev=205408&view=rev
Log:
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.
Modified:
clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp
clang-tools-extra/trunk/test/clang-tidy/basic.cpp
clang-tools-extra/trunk/test/clang-tidy/deduplication.cpp
clang-tools-extra/trunk/test/clang-tidy/diagnostic.cpp
clang-tools-extra/trunk/test/clang-tidy/fix.cpp
clang-tools-extra/trunk/test/clang-tidy/macros.cpp
clang-tools-extra/trunk/test/clang-tidy/nolint.cpp
clang-tools-extra/trunk/test/clang-tidy/select-checks.cpp
clang-tools-extra/trunk/test/clang-tidy/static-analyzer.cpp
Modified: clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp Wed Apr 2 03:52:06 2014
@@ -37,7 +37,7 @@ static cl::opt<std::string> DisableCheck
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));
Modified: clang-tools-extra/trunk/test/clang-tidy/basic.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/basic.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/basic.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/basic.cpp Wed Apr 2 03:52:06 2014
@@ -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 {
Modified: clang-tools-extra/trunk/test/clang-tidy/deduplication.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/deduplication.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/deduplication.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/deduplication.cpp Wed Apr 2 03:52:06 2014
@@ -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); };
Modified: clang-tools-extra/trunk/test/clang-tidy/diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/diagnostic.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/diagnostic.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/diagnostic.cpp Wed Apr 2 03:52:06 2014
@@ -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
Modified: clang-tools-extra/trunk/test/clang-tidy/fix.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/fix.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/fix.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/fix.cpp Wed Apr 2 03:52:06 2014
@@ -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
Modified: clang-tools-extra/trunk/test/clang-tidy/macros.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/macros.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/macros.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/macros.cpp Wed Apr 2 03:52:06 2014
@@ -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); }
Modified: clang-tools-extra/trunk/test/clang-tidy/nolint.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/nolint.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/nolint.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/nolint.cpp Wed Apr 2 03:52:06 2014
@@ -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]
Modified: clang-tools-extra/trunk/test/clang-tidy/select-checks.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/select-checks.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/select-checks.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/select-checks.cpp Wed Apr 2 03:52:06 2014
@@ -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 {
Modified: clang-tools-extra/trunk/test/clang-tidy/static-analyzer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/static-analyzer.cpp?rev=205408&r1=205407&r2=205408&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/static-analyzer.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/static-analyzer.cpp Wed Apr 2 03:52:06 2014
@@ -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 *);
More information about the cfe-commits
mailing list