summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h
Commit message (Collapse)AuthorAgeFilesLines
* [VFS] Switch clang-tidy tests to use an in-memory fs.Benjamin Kramer2015-10-071-4/+8
| | | | | | | Again, this is both cleaner and completely removes any depedency on the host file system. llvm-svn: 249526
* Create interfaces and tests for the overlapping replacements fix in clang-tidy.Angel Garcia Gomez2015-10-061-8/+32
| | | | | | | | | | | | Summary: No changes in clang-tidy yet. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13469 llvm-svn: 249402
* Move some more functionality into the AST consumer creation factory ↵Aaron Ballman2015-09-021-3/+6
| | | | | | function, before registering matchers with the MatchFinder object. This allows us to set the language options for the ClangTidyContext object appropriately so that they can be used from registerMatchers(), and more closely models the way the clang-tidy tool works. llvm-svn: 246660
* Fix formatting.Manuel Klimek2015-08-131-1/+1
| | | | llvm-svn: 244876
* Reinstantiate better diagnostic, this time with a fatal error so we don't ↵Manuel Klimek2015-08-121-2/+7
| | | | | | add a dependency onto gtest from the header. llvm-svn: 244722
* Revert the diagnostic improvements in r244602 as they introduced a ↵David Blaikie2015-08-111-9/+1
| | | | | | | | | | problematic dependency Seems we had some internal uses that include ClangTidyTest.h and weren't ready for a gtest dependency. Reverting to give Manuel some time to look into it. llvm-svn: 244658
* 1. Disable tests that currently cannot work on windows due to missing path ↵Manuel Klimek2015-08-111-1/+9
| | | | | | | | canonicalization in the file manager. 2. Add better output when a clang-tidy unit test fails so it's clear what the error is. llvm-svn: 244602
* Default initialize from explicitly constructed object.Manuel Klimek2015-08-111-2/+3
| | | | llvm-svn: 244596
* Add an IncludeInserter to clang-tidy.Manuel Klimek2015-08-111-1/+8
| | | | | | Will be used to allow checks to insert includes at the right position. llvm-svn: 244586
* [clang-tidy] Set current main file name in tests.Alexander Kornienko2015-07-271-0/+1
| | | | llvm-svn: 243272
* Force braces on the else branch if they are being added to the if branch.Samuel Benzaquen2015-03-311-5/+6
| | | | | | | | | | | | | | Summary: Force braces on the else branch if they are being added to the if branch. This ensures consistency in the transformed code. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8708 llvm-svn: 233697
* [clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC.Alexander Kornienko2015-03-091-3/+3
| | | | | | | | | | The patch was generated using this command: $ clang-tidy/tool/run-clang-tidy.py -header-filter=.*clang-tidy.* -fix \ -checks=-*,llvm-header-guard clang-tidy.* $ svn revert --recursive clangt-tidy/llvm/ (to revert a few buggy fixes) llvm-svn: 231669
* [clang-tidy] Organized clang-tidy unit tests. NFC.Alexander Kornienko2015-03-021-0/+3
| | | | | | | | | * Moved unit tests for BracesAroundStatementsCheck to ReadabilityModuleTest.cpp. * Moved EXPECT_NO_CHANGES macro to ClangTidyTest.h to avoid defining it three times. llvm-svn: 230947
* Small cleanups from review comments.Manuel Klimek2014-10-091-5/+3
| | | | llvm-svn: 219409
* Make clang-tidy's runCheckOnCode actually use the DiagnosticConsumer.Manuel Klimek2014-10-071-18/+26
| | | | | | | | | A precondition of that was to run both the preprocessor checks and AST checks from the same FrontendAction, otherwise we'd have needed to duplicate all involved objects in order to not have any references to a deleted source manager. llvm-svn: 219212
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-121-2/+1
| | | | | | | | | | | | | | | | | Summary: Each check can implement readOptions and storeOptions methods to read and store custom options. Each check's options are stored in a local namespace to avoid name collisions and provide some sort of context to the user. Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5296 llvm-svn: 217661
* Implemented clang-tidy configurability via .clang-tidy files.Alexander Kornienko2014-09-041-2/+4
| | | | | | | | | | | | | | | | | 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
* Allow specifying file names and extra arguments when running clang-tidy unit ↵Benjamin Kramer2014-08-121-3/+7
| | | | | | | | tests. Will become useful soon. llvm-svn: 215438
* Allow per-file clang-tidy options.Alexander Kornienko2014-06-051-2/+2
| | | | | | | | | | | | | | | | | | Summary: This patch makes it possible for clang-tidy clients to provide different options for different translation units. The option, which doesn't make sense to be file-dependent, was moved to a separate ClangTidyGlobalOptions struct. Added parsing of ClangTidyOptions. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3979 llvm-svn: 210260
* Store Errors inside ClangTidyContext instead of just pointer to an externalAlexander Kornienko2014-05-091-8/+6
| | | | | | | | | | | | | | | array. This simplifies usage of ClangTidyContext a bit and seems to be more consistent. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3685 llvm-svn: 208407
* Add ClangTidyOptions to encapsulate all clang-tidy options.Alexander Kornienko2014-04-291-5/+3
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3544 llvm-svn: 207532
* Output clang-tidy errors in a consistent order.Alexander Kornienko2014-04-081-2/+8
| | | | | | | | | | | | | | Summary: Sort errors by path, file offset and message. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://reviews.llvm.org/D3314 llvm-svn: 205759
* ClangTidyTest.h: Don't use initializer list. msc17 doesn't recognize one.NAKAMURA Takumi2014-03-201-2/+3
| | | | llvm-svn: 204332
* Post-filter clang-tidy diagnostic messages.Alexander Kornienko2014-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* clang-tidy explicit constructors check: don't warn on deleted constructors.Alexander Kornienko2014-03-191-2/+3
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3116 llvm-svn: 204226
* [C++11] Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-091-1/+1
| | | | | | | | This removes all references to OwningPtr, which should be fairly undisruptive to out-of-tree projects since they are unlikely to use clang-tools-extra as a library instead of a set of tools. llvm-svn: 203382
* [C++11] Replace LLVM_OVERRIDE with 'override'Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202632
* Made the ClangTidyTest helper class independent of the testing framework.Alexander Kornienko2014-02-271-43/+37
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2895 llvm-svn: 202399
* Make clang's static analyzer checks available through clang-tidy.Manuel Klimek2013-11-141-0/+1
| | | | | | | | | | | | | This is implemented in a way that the current static analyzer architecture allows, in the future we might want to revisit this. With this change static analyzer checks are available from clang-tidy by specifying -checks=clang-analyzer-<name>. This change also fixes the use of the compilation database to allow clang-tidy to be used like any other clang tool. llvm-svn: 194707
* Initial architecture for clang-tidy.Daniel Jasper2013-07-291-0/+75
This is the first version of a possible clang-tidy architecture. The purpose of clang-tidy is to detect errors in adhering to common coding patterns, e.g. described in the LLVM Coding Standards. This is still heavily in flux. Review: http://llvm-reviews.chandlerc.com/D884 llvm-svn: 187345
OpenPOWER on IntegriCloud