[clang-tools-extra] r268579 - [clang-tidy] Improve -warnings-as-errors tests.
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Wed May 4 17:09:29 PDT 2016
Author: alexfh
Date: Wed May 4 19:09:29 2016
New Revision: 268579
URL: http://llvm.org/viewvc/llvm-project?rev=268579&view=rev
Log:
[clang-tidy] Improve -warnings-as-errors tests.
Added:
clang-tools-extra/trunk/test/clang-tidy/werrors-diagnostics.cpp
Modified:
clang-tools-extra/trunk/test/clang-tidy/werrors-plural.cpp
clang-tools-extra/trunk/test/clang-tidy/werrors.cpp
Added: clang-tools-extra/trunk/test/clang-tidy/werrors-diagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/werrors-diagnostics.cpp?rev=268579&view=auto
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/werrors-diagnostics.cpp (added)
+++ clang-tools-extra/trunk/test/clang-tidy/werrors-diagnostics.cpp Wed May 4 19:09:29 2016
@@ -0,0 +1,13 @@
+// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \
+// RUN: -- -Wunused-variable 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:'
+// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \
+// RUN: -warnings-as-errors='clang-diagnostic*' -- -Wunused-variable 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:'
+
+void f() { int i; }
+// CHECK-WARN: warning: unused variable 'i' [clang-diagnostic-unused-variable]
+// CHECK-WERR: error: unused variable 'i' [clang-diagnostic-unused-variable,-warnings-as-errors]
+
+// CHECK-WARN-NOT: treated as
+// CHECK-WERR: 1 warning treated as error
Modified: clang-tools-extra/trunk/test/clang-tidy/werrors-plural.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/werrors-plural.cpp?rev=268579&r1=268578&r2=268579&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/werrors-plural.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/werrors-plural.cpp Wed May 4 19:09:29 2016
@@ -1,5 +1,8 @@
-// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WARN
-// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment' -warnings-as-errors='llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WERR
+// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' -- 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:'
+// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \
+// RUN: -warnings-as-errors='llvm-namespace-comment' -- 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:'
namespace j {
}
Modified: clang-tools-extra/trunk/test/clang-tidy/werrors.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/werrors.cpp?rev=268579&r1=268578&r2=268579&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/werrors.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/werrors.cpp Wed May 4 19:09:29 2016
@@ -1,5 +1,5 @@
-// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WARN
-// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment' -warnings-as-errors='llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WERR
+// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:'
+// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment' -warnings-as-errors='llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:'
namespace i {
}
More information about the cfe-commits
mailing list