diff options
author | Brad King <brad.king@kitware.com> | 2017-10-27 12:31:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-27 13:26:50 (GMT) |
commit | 992962c76dd472fa9d122231c89d8d11aedd3288 (patch) | |
tree | de761b94f411e05bba39e27f188f4a9087e13da2 /Tests/RunCMake/MultiLint | |
parent | a5197eeac7a28046729c40067ee02cd7e3e8e01b (diff) | |
download | CMake-992962c76dd472fa9d122231c89d8d11aedd3288.zip CMake-992962c76dd472fa9d122231c89d8d11aedd3288.tar.gz CMake-992962c76dd472fa9d122231c89d8d11aedd3288.tar.bz2 |
cmcmd: Restore support for running multiple lint tools
Refactoring in commit v3.10.0-rc1~115^2 (Clean up iwyu code to not be
one big if statement, 2017-08-28) incorrectly changed the logic to run
only one lint tool at a time. Restore support for running all tools
specified on the command-line.
Diffstat (limited to 'Tests/RunCMake/MultiLint')
-rw-r--r-- | Tests/RunCMake/MultiLint/C-Build-stdout.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/C-launch-Build-stdout.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/C-launch.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/C.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/CXX-Build-stdout.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/CXX-launch-Build-stdout.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/CXX-launch.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/CXX.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/RunCMakeTest.cmake | 27 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/main.c | 4 | ||||
-rw-r--r-- | Tests/RunCMake/MultiLint/main.cxx | 4 |
12 files changed, 88 insertions, 0 deletions
diff --git a/Tests/RunCMake/MultiLint/C-Build-stdout.txt b/Tests/RunCMake/MultiLint/C-Build-stdout.txt new file mode 100644 index 0000000..d10427e --- /dev/null +++ b/Tests/RunCMake/MultiLint/C-Build-stdout.txt @@ -0,0 +1,8 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> ++ +.*Tests[/\]RunCMake[/\]MultiLint[/\]main\.c:0:0: warning: message \[checker\].* +Total errors found: 0 +.*Warning: cppcheck reported diagnostics.*error.*warning.*style.*performance.*information.* diff --git a/Tests/RunCMake/MultiLint/C-launch-Build-stdout.txt b/Tests/RunCMake/MultiLint/C-launch-Build-stdout.txt new file mode 100644 index 0000000..d10427e --- /dev/null +++ b/Tests/RunCMake/MultiLint/C-launch-Build-stdout.txt @@ -0,0 +1,8 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> ++ +.*Tests[/\]RunCMake[/\]MultiLint[/\]main\.c:0:0: warning: message \[checker\].* +Total errors found: 0 +.*Warning: cppcheck reported diagnostics.*error.*warning.*style.*performance.*information.* diff --git a/Tests/RunCMake/MultiLint/C-launch.cmake b/Tests/RunCMake/MultiLint/C-launch.cmake new file mode 100644 index 0000000..e66ca20 --- /dev/null +++ b/Tests/RunCMake/MultiLint/C-launch.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(C.cmake) diff --git a/Tests/RunCMake/MultiLint/C.cmake b/Tests/RunCMake/MultiLint/C.cmake new file mode 100644 index 0000000..495d6f0 --- /dev/null +++ b/Tests/RunCMake/MultiLint/C.cmake @@ -0,0 +1,6 @@ +enable_language(C) +set(CMAKE_C_INCLUDE_WHAT_YOU_USE "${PSEUDO_IWYU}" -some -args) +set(CMAKE_C_CLANG_TIDY "${PSEUDO_TIDY}" -some -args) +set(CMAKE_C_CPPLINT "${PSEUDO_CPPLINT}" --verbose=0 --linelength=80) +set(CMAKE_C_CPPCHECK "${PSEUDO_CPPCHECK}") +add_executable(main main.c) diff --git a/Tests/RunCMake/MultiLint/CMakeLists.txt b/Tests/RunCMake/MultiLint/CMakeLists.txt new file mode 100644 index 0000000..bf2ef15 --- /dev/null +++ b/Tests/RunCMake/MultiLint/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.10) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/MultiLint/CXX-Build-stdout.txt b/Tests/RunCMake/MultiLint/CXX-Build-stdout.txt new file mode 100644 index 0000000..aaf5fd7 --- /dev/null +++ b/Tests/RunCMake/MultiLint/CXX-Build-stdout.txt @@ -0,0 +1,8 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> ++ +.*Tests[/\]RunCMake[/\]MultiLint[/\]main\.cxx:0:0: warning: message \[checker\].* +Total errors found: 0 +.*Warning: cppcheck reported diagnostics.*error.*warning.*style.*performance.*information.* diff --git a/Tests/RunCMake/MultiLint/CXX-launch-Build-stdout.txt b/Tests/RunCMake/MultiLint/CXX-launch-Build-stdout.txt new file mode 100644 index 0000000..aaf5fd7 --- /dev/null +++ b/Tests/RunCMake/MultiLint/CXX-launch-Build-stdout.txt @@ -0,0 +1,8 @@ +Warning: include-what-you-use reported diagnostics: +should add these lines: +* +#include <\.\.\.> ++ +.*Tests[/\]RunCMake[/\]MultiLint[/\]main\.cxx:0:0: warning: message \[checker\].* +Total errors found: 0 +.*Warning: cppcheck reported diagnostics.*error.*warning.*style.*performance.*information.* diff --git a/Tests/RunCMake/MultiLint/CXX-launch.cmake b/Tests/RunCMake/MultiLint/CXX-launch.cmake new file mode 100644 index 0000000..3002c9d --- /dev/null +++ b/Tests/RunCMake/MultiLint/CXX-launch.cmake @@ -0,0 +1,3 @@ +set(CTEST_USE_LAUNCHERS 1) +include(CTestUseLaunchers) +include(CXX.cmake) diff --git a/Tests/RunCMake/MultiLint/CXX.cmake b/Tests/RunCMake/MultiLint/CXX.cmake new file mode 100644 index 0000000..dc30146 --- /dev/null +++ b/Tests/RunCMake/MultiLint/CXX.cmake @@ -0,0 +1,6 @@ +enable_language(CXX) +set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${PSEUDO_IWYU}" -some -args) +set(CMAKE_CXX_CLANG_TIDY "${PSEUDO_TIDY}" -some -args) +set(CMAKE_CXX_CPPLINT "${PSEUDO_CPPLINT}" --verbose=0 --linelength=80) +set(CMAKE_CXX_CPPCHECK "${PSEUDO_CPPCHECK}") +add_executable(main main.cxx) diff --git a/Tests/RunCMake/MultiLint/RunCMakeTest.cmake b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake new file mode 100644 index 0000000..afd98fd --- /dev/null +++ b/Tests/RunCMake/MultiLint/RunCMakeTest.cmake @@ -0,0 +1,27 @@ +include(RunCMake) + +set(RunCMake_TEST_OPTIONS + "-DPSEUDO_CPPCHECK=${PSEUDO_CPPCHECK}" + "-DPSEUDO_CPPLINT=${PSEUDO_CPPLINT}" + "-DPSEUDO_IWYU=${PSEUDO_IWYU}" + "-DPSEUDO_TIDY=${PSEUDO_TIDY}" + ) + +function(run_multilint lang) + # Use a single build tree for tests without cleaning. + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${lang}-build") + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(${lang}) + set(RunCMake_TEST_OUTPUT_MERGE 1) + run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build .) +endfunction() + +run_multilint(C) +run_multilint(CXX) + +if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake") + run_multilint(C-launch) + run_multilint(CXX-launch) +endif() diff --git a/Tests/RunCMake/MultiLint/main.c b/Tests/RunCMake/MultiLint/main.c new file mode 100644 index 0000000..8488f4e --- /dev/null +++ b/Tests/RunCMake/MultiLint/main.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} diff --git a/Tests/RunCMake/MultiLint/main.cxx b/Tests/RunCMake/MultiLint/main.cxx new file mode 100644 index 0000000..f8b643a --- /dev/null +++ b/Tests/RunCMake/MultiLint/main.cxx @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} |