summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake
Commit message (Collapse)AuthorAgeFilesLines
* IWYU: Return error code if user enables error reportingAshish Sadanandan2023-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously CMake ignored the return code from iwyu because old versions of the tool would exit with an error code even when no header include violations were detected. The iwyu project has since changed this behavior, so the tool no longer returns an error code unless the user enables error reporting via command line arguments. Behavior seen with iwyu version 0.19 Source file with missing includes: - Case 1: iwyu arguments: - return code: 0 - output: <report of all missing includes> - Case 2: iwyu arguments: `-Xiwyu --error` - return code: 1 - output: <report of all missing includes> Source file with no missing includes: - Case 1: iwyu arguments: - return code: 0 - output: `(/path/to/file.cc has correct #includes/fwd-decls)` - Case 2: iwyu arguments: `-Xiwyu --error` - return code: 0 - output: `(/path/to/file.cc has correct #includes/fwd-decls)` Teach CMake to return the iwyu return code if the user has invoked the tool with any of these command line arguments included: - `--error[=N]` - `--error_always[=N]` Fixes: #24066
* Makefile: Fix <LANG>_INCLUDE_WHAT_YOU_USE with CTEST_USE_LAUNCHERSBrad King2015-05-221-0/+4
| | | | | | The 'ctest --launch' command must be placed before the IWYU launcher on the compiler command line. Extend the RunCMake.IncludeWhatYouUse test to cover this case. The Ninja generator already does it correctly.
* Add options to run include-what-you-use with the compilerBrad King2015-05-191-0/+18
Create a <LANG>_INCLUDE_WHAT_YOU_USE target property (initialized by a CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE variable) to specify an IWYU command line to be run along with the compiler.