diff options
author | Brad King <brad.king@kitware.com> | 2023-04-26 14:31:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-04-26 14:31:11 (GMT) |
commit | 663cc941bd176347fb2fa89191629c6843bb4ebd (patch) | |
tree | 29ba5b109e407ac4a63608db7e68109f9147b56c /Tests | |
parent | d5d06ec444db38e535c7da303b36af6204fd734f (diff) | |
parent | fcacc319d9e1a3ea89b33d58c495f32199f6ec91 (diff) | |
download | CMake-663cc941bd176347fb2fa89191629c6843bb4ebd.zip CMake-663cc941bd176347fb2fa89191629c6843bb4ebd.tar.gz CMake-663cc941bd176347fb2fa89191629c6843bb4ebd.tar.bz2 |
Merge topic 'iwyu_errors'
fcacc319d9 IWYU: Return error code if user enables error reporting
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8406
Diffstat (limited to 'Tests')
7 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/IncludeWhatYouUse/C-error-Build-result.txt b/Tests/RunCMake/IncludeWhatYouUse/C-error-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/C-error-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/IncludeWhatYouUse/C-error-Build-stdout.txt b/Tests/RunCMake/IncludeWhatYouUse/C-error-Build-stdout.txt new file mode 100644 index 0000000..cb74677 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/C-error-Build-stdout.txt @@ -0,0 +1,4 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> diff --git a/Tests/RunCMake/IncludeWhatYouUse/C-error.cmake b/Tests/RunCMake/IncludeWhatYouUse/C-error.cmake new file mode 100644 index 0000000..d5230bb --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/C-error.cmake @@ -0,0 +1,3 @@ +enable_language(C) +set(CMAKE_C_INCLUDE_WHAT_YOU_USE "${PSEUDO_IWYU}" -Xiwyu --error) +add_executable(main main.c) diff --git a/Tests/RunCMake/IncludeWhatYouUse/CXX-error-Build-result.txt b/Tests/RunCMake/IncludeWhatYouUse/CXX-error-Build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/CXX-error-Build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/IncludeWhatYouUse/CXX-error-Build-stdout.txt b/Tests/RunCMake/IncludeWhatYouUse/CXX-error-Build-stdout.txt new file mode 100644 index 0000000..cb74677 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/CXX-error-Build-stdout.txt @@ -0,0 +1,4 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> diff --git a/Tests/RunCMake/IncludeWhatYouUse/CXX-error.cmake b/Tests/RunCMake/IncludeWhatYouUse/CXX-error.cmake new file mode 100644 index 0000000..1d10a55 --- /dev/null +++ b/Tests/RunCMake/IncludeWhatYouUse/CXX-error.cmake @@ -0,0 +1,3 @@ +enable_language(CXX) +set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "$<1:${PSEUDO_IWYU}>" -Xiwyu --error) +add_executable(main main.cxx) diff --git a/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake b/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake index 8f99eb1..8ec24be 100644 --- a/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake +++ b/Tests/RunCMake/IncludeWhatYouUse/RunCMakeTest.cmake @@ -16,6 +16,8 @@ endfunction() run_iwyu(C) run_iwyu(CXX) +run_iwyu(C-error) +run_iwyu(CXX-error) if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") run_iwyu(C-launch) run_iwyu(CXX-launch) |