summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
diff options
context:
space:
mode:
authorJonas Toth <jonas.toth@gmail.com>2018-08-30 08:44:27 +0000
committerJonas Toth <jonas.toth@gmail.com>2018-08-30 08:44:27 +0000
commit5c0f66b1feaf995dcd51ac4ef260f1f58a52ea9b (patch)
treef864c68a84d798259f1235c486689c59eda2e409 /clang-tools-extra/test/clang-tidy/check_clang_tidy.py
parentcd5bc7be0849a2b3a2452c587613a89301c2e20a (diff)
downloadbcm5719-llvm-5c0f66b1feaf995dcd51ac4ef260f1f58a52ea9b.tar.gz
bcm5719-llvm-5c0f66b1feaf995dcd51ac4ef260f1f58a52ea9b.zip
[clang-tidy] fix check_clang_tidy to forbid mixing of CHECK-NOTES and CHECK-MESSAGES
Summary: The check_clang_tidy.py script would allow mixing of `CHECK-NOTES` and `CHECK-MESSAGES` but running `FileCheck` for that would implicitly fail, because `CHECK-NOTES` bails out if there is a warning. That means a clang-tidy test can not mix these constructs to check warnings with `CHECK-MESSAGES` and notes with `CHECK-NOTES`. The script gives now a clear error if that happens. Reviewers: alexfh, aaron.ballman, lebedev.ri, hokein Reviewed By: lebedev.ri Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D51381 llvm-svn: 341039
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/check_clang_tidy.py')
-rwxr-xr-xclang-tools-extra/test/clang-tidy/check_clang_tidy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
index dadb84d5790..d8086b16eae 100755
--- a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
+++ b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py
@@ -98,6 +98,9 @@ def main():
sys.exit('%s, %s or %s not found in the input' % (check_fixes_prefix,
check_messages_prefix, check_notes_prefix) )
+ if has_check_notes and has_check_messages:
+ sys.exit('Please use either CHECK-NOTES or CHECK-MESSAGES but not both')
+
# 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
OpenPOWER on IntegriCloud