[clang-tidy] Customize FileCheck prefix in check_clang-tidy.py
authorZinovy Nis <zinovy.nis@gmail.com>
Sat, 21 Apr 2018 15:23:56 +0000 (15:23 +0000)
committerZinovy Nis <zinovy.nis@gmail.com>
Sat, 21 Apr 2018 15:23:56 +0000 (15:23 +0000)
commiteba2857bed15028b6e2d2be3640b1de4c6957037
treea0be7527e04fb191ea9f22f6ab0b84baa43e4c60
parent93b102cd459e60b4c60648f17f956bb3f66b0c97
[clang-tidy] Customize FileCheck prefix in check_clang-tidy.py

The patch introduces a new command line option '-check-suffix' for check_clang_tidy.py
to allow multiple %check_clang_tidy% in a single test file.

Sample:

// RUN: %check_clang_tidy -check-suffix=FLAG-1 %s misc-unused-using-decls %t -- -- <options-set-1>
// RUN: %check_clang_tidy -check-suffix=FLAG-2 %s misc-unused-using-decls %t -- -- <options-set-2>
...
+// CHECK-MESSAGES-FLAG-1: :[[@LINE-4]]:10: warning: using decl 'B' is unused [misc-unused-using-decls]
+// CHECK-MESSAGES-FLAG-2: :[[@LINE-7]]:10: warning: using decl 'A' is unused [misc-unused-using-decls]
+// CHECK-FIXES-FLAG-1-NOT: using a::A;$
+// CHECK-FIXES-FLAG-2-NOT: using a::B;$

Differential Revision: https://reviews.llvm.org/D45776

llvm-svn: 330511
clang-tools-extra/docs/clang-tidy/index.rst
clang-tools-extra/test/clang-tidy/check_clang_tidy.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/check_clang_tidy.py