summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/diagnostic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-52/+0
| | | | | | | | | | | | | | | | | | | | Summary: This change moves tests for checkers and infrastructure into separate directories, making it easier to find infrastructure tests. Tests for checkers are already easy to find because they are named after the checker. Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers. Now they are in a separate directory. Reviewers: jfb, jdoerfert, lebedev.ri Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68807 llvm-svn: 374540
* [clang-tidy] fix test after r346414Sam McCall2018-11-081-1/+3
| | | | llvm-svn: 346415
* [clang-tidy] Return non-zero exit code for clang errors.Alexander Kornienko2018-04-091-10/+20
| | | | | | | | | | | | | | | | Summary: Updated tests broken by this change. Fixes https://bugs.llvm.org/show_bug.cgi?id=27628 Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D45258 llvm-svn: 329579
* Fix clang-tidy diagnostic.cpp test on WindowsReid Kleckner2017-07-111-1/+1
| | | | llvm-svn: 307701
* [clang-tidy] Extend diagnostics test.Alexander Kornienko2017-07-111-5/+26
| | | | | | | | * test that no diagnostics are redirected to stderr * test that a file-based compilation database is not picked up when the command line after -- contains an error llvm-svn: 307661
* Revert "Modify test so that it looks for patterns in stderr as well"Benjamin Kramer2017-06-301-4/+4
| | | | | | | This reverts commit r303735. No longer needed after r306822 sends the diagnostics to the proper output again. llvm-svn: 306823
* Modify test so that it looks for patterns in stderr as wellSerge Pavlov2017-05-241-4/+4
| | | | | | | | | | | | | | | With the change https://reviews.llvm.org/D33013 driver will not build compilation object if command line is invalid, in particular, if unrecognized option is provided. In such cases it will prints diagnostics on stderr. The test 'clang-tidy/diagnostic.cpp' checks reaction on unrecognized option and will fail when D33013 is applied because it checks only stdout for test patterns and expects the name of diagnostic category prepared by clang-tidy. With this change the test makes more general check and must work in either case. Differential Revision: https://reviews.llvm.org/D33173 llvm-svn: 303735
* [clang-tidy] google-explicit-constructor: improve the warning messageAlexander Kornienko2015-11-281-2/+2
| | | | | | Also switch some more tests to %check_clang_tidy. llvm-svn: 254216
* [clang-tidy] Added missing check lines, made the checking stricter.Alexander Kornienko2015-09-301-11/+5
| | | | llvm-svn: 248899
* [clang-tidy] Move misc-use-override and readability-shrink-to-fit to ↵Alexander Kornienko2015-08-311-2/+2
| | | | | | | | | "modernize/" These checks are focusing on migrating the code from C++98/03 to C++11, so they belong to the modernize module. llvm-svn: 246437
* [clang-tidy] Support initializer_list in google-explicit-constructor checkAlexander Kornienko2014-11-271-2/+2
| | | | | | | | | | | | | | | | | | | Summary: According to the Google C++ Style Guide, constructors taking a single std::initializer_list<> should not be marked explicit. This change also changes the messages according to conventions used in Clang diagnostics: no capitalization of the first letter, no trailing dot. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D6427 llvm-svn: 222878
* Implemented clang-tidy configurability via .clang-tidy files.Alexander Kornienko2014-09-041-1/+1
| | | | | | | | | | | | | | | | | Summary: This adds a support for the .clang-tidy file reading using FileOptionsProvider, -dump-config option, and changes tests to not depend on default checks set. Reviewers: klimek, bkramer, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5186 llvm-svn: 217155
* Make the diagnostic message more complete to check the check name.Alexander Kornienko2014-07-171-1/+1
| | | | llvm-svn: 213245
* Fix the diagnostic.cpp test to explicitly disable more google checksReid Kleckner2014-07-151-1/+1
| | | | | | | | | Imagine, hypothetically, that you had a build of clang-tidy that enabled the google-* checks by default. If you had such a binary, then this test would fail. Making it pass in that configuration isn't such a bad thing. llvm-svn: 213085
* Consistently handle clang-tidy check names in ClangTidyError.Alexander Kornienko2014-07-021-2/+2
| | | | | | | | | | | | | | | | | | | Summary: This patch removes " [check-name]" from the end of ClangTidyMessage::Message. The " [check-name]" part is only appended when printing diagnostics on the console. Clang errors are now marked with "clang-diagnostic-error" check name, remarks and unknown warnings are marked with "clang-diagnostic-unknown". Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4356 llvm-svn: 212180
* Never filter-out compile errors in clang-tidy, display them as errors.Alexander Kornienko2014-06-021-3/+3
| | | | | | | | | | | | | | | | | | Summary: No filters should affect the display of errors. Fixed a few tests, which had compile errors. We need to think what we should do with mapped errors (-Werror). Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3982 llvm-svn: 210044
* Exit with error when no checks enabled.Alexander Kornienko2014-06-021-1/+1
| | | | | | | | | | | | | | | | Summary: This seems like a more appropriate reaction to the user specifying a single check with a wrong name, for example. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3981 llvm-svn: 210043
* Change the behavior of clang-tidy -checks=, remove -disable-checks.Alexander Kornienko2014-05-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make checks filtering more intuitive and easy to use. Remove -disable-checks and change the format of -checks= to a comma-separated list of globs with optional '-' prefix to denote exclusion. The -checks= option is now cumulative, so it modifies defaults, not overrides them. Each glob adds or removes to the current set of checks, so the filter can be refined or overriden by adding globs. Example: The default value for -checks= is '*,-clang-analyzer-alpha*,-llvm-include-order,-llvm-namespace-comment,-google-*', which allows all checks except for the ones named clang-analyzer-alpha* and others specified with the leading '-'. To allow all google-* checks one can write: clang-tidy -checks=google-* ... If one needs only google-* checks, we first need to remove everything (-*): clang-tidy -checks=-*,google-* etc. I'm not sure if we need to change something here, so I didn't touch the docs yet. Reviewers: klimek, alexfh Reviewed By: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3770 llvm-svn: 208883
* Fix a crash when diagnostic points to a macro definition on command line.Alexander Kornienko2014-05-061-0/+4
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3620 llvm-svn: 208068
* Fix regex bug in clang-tidy.Daniel Jasper2014-04-021-3/+3
| | | | | | | | 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
* Post-filter clang-tidy diagnostic messages.Alexander Kornienko2014-03-201-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements filtering of clang-tidy diagnostic messages by the check name, so that "clang-tidy -checks=^llvm-" won't output any clang warnings, for example. This is also helpful to run specific static-analyzer checks: static analyzer always needs core checks to be enabled, but the user may be interested only in the checks he asked for. This patch also exposes warning option names for built-in diagnostics. We need to have a namespace for these names to avoid collisions and to allow convenient filtering, so I prefix them with "-W". I'm not sure it's the best thing to do, and maybe "W" or "clang-diagnostic-" or something like this would be better. Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3121 llvm-svn: 204321
* Fixed a crash when handling diagnostics without a valid file location, e.g. ↵Alexander Kornienko2014-03-051-4/+4
| | | | | | 'error reading <file>'. llvm-svn: 202987
* Fix crash when handling an argument parsing-related warning.Alexander Kornienko2014-02-031-0/+5
Summary: Don't crash on warnings coming before the translation unit starts. Reviewers: klimek, djasper Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2676 llvm-svn: 200702
OpenPOWER on IntegriCloud