diff options
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/Autogen/AutogenSkipLinting-build-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Autogen/AutogenSkipLinting.cmake | 16 | ||||
-rw-r--r-- | Tests/RunCMake/Autogen/RunCMakeTest.cmake | 15 | ||||
-rw-r--r-- | Tests/RunCMake/Autogen/SkipLinting.cxx | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Autogen/SkipLinting.h | 11 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 4 |
6 files changed, 53 insertions, 0 deletions
diff --git a/Tests/RunCMake/Autogen/AutogenSkipLinting-build-stderr.txt b/Tests/RunCMake/Autogen/AutogenSkipLinting-build-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/Autogen/AutogenSkipLinting-build-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/Autogen/AutogenSkipLinting.cmake b/Tests/RunCMake/Autogen/AutogenSkipLinting.cmake new file mode 100644 index 0000000..3ce2092 --- /dev/null +++ b/Tests/RunCMake/Autogen/AutogenSkipLinting.cmake @@ -0,0 +1,16 @@ +enable_language(CXX) + +find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "$<1:${PSEUDO_IWYU}>" -some -args) +set(CMAKE_CXX_CLANG_TIDY "$<1:${PSEUDO_TIDY}>" -bad) +set(CMAKE_CXX_CPPLINT "$<1:${PSEUDO_CPPLINT}>" --error) +set(CMAKE_CXX_CPPCHECK "$<1:${PSEUDO_CPPCHECK}>" -error) + +add_executable(SkipLinting SkipLinting.cxx SkipLinting.h) +set_source_files_properties(SkipLinting.cxx PROPERTIES SKIP_LINTING TRUE) + +target_link_libraries(SkipLinting Qt${with_qt_version}::Core + Qt${with_qt_version}::Widgets + Qt${with_qt_version}::Gui) diff --git a/Tests/RunCMake/Autogen/RunCMakeTest.cmake b/Tests/RunCMake/Autogen/RunCMakeTest.cmake index 4505132..97b64ed 100644 --- a/Tests/RunCMake/Autogen/RunCMakeTest.cmake +++ b/Tests/RunCMake/Autogen/RunCMakeTest.cmake @@ -87,5 +87,20 @@ if (DEFINED with_qt_version) message(STATUS "RunCMake_TEST_EXPECT_stdout: ${RunCMake_TEST_EXPECT_stdout}") run_cmake_command(AutogenUseSystemIncludeOff ${CMAKE_COMMAND} --build . --config Debug --verbose) endblock() + + if(RunCMake_GENERATOR MATCHES "Make|Ninja") + block() + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AutogenSkipLinting-build) + list(APPEND RunCMake_TEST_OPTIONS + "-DPSEUDO_CPPCHECK=${PSEUDO_CPPCHECK}" + "-DPSEUDO_CPPLINT=${PSEUDO_CPPLINT}" + "-DPSEUDO_IWYU=${PSEUDO_IWYU}" + "-DPSEUDO_TIDY=${PSEUDO_TIDY}") + + run_cmake(AutogenSkipLinting) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(AutogenSkipLinting-build ${CMAKE_COMMAND} --build . --config Debug --verbose) + endblock() + endif() endif() endif () diff --git a/Tests/RunCMake/Autogen/SkipLinting.cxx b/Tests/RunCMake/Autogen/SkipLinting.cxx new file mode 100644 index 0000000..9e09b27 --- /dev/null +++ b/Tests/RunCMake/Autogen/SkipLinting.cxx @@ -0,0 +1,6 @@ +#include "SkipLinting.h" + +int main() +{ + return 0; +} diff --git a/Tests/RunCMake/Autogen/SkipLinting.h b/Tests/RunCMake/Autogen/SkipLinting.h new file mode 100644 index 0000000..def56a0 --- /dev/null +++ b/Tests/RunCMake/Autogen/SkipLinting.h @@ -0,0 +1,11 @@ +#ifndef SKIP_LINTING_H +#define SKIP_LINTING_H + +#include <QObject> + +class SkipMe : public QObject +{ + Q_OBJECT +}; + +#endif diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index cea8cff..58f06de 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -266,6 +266,10 @@ if(CMake_TEST_Qt6 AND Qt6Widgets_FOUND) -Dwith_qt_version=6 "-DQt6_DIR:PATH=${Qt6_DIR}" "-DCMAKE_PREFIX_PATH:STRING=${base_dir}" + -DPSEUDO_TIDY=$<TARGET_FILE:pseudo_tidy> + -DPSEUDO_IWYU=$<TARGET_FILE:pseudo_iwyu> + -DPSEUDO_CPPLINT=$<TARGET_FILE:pseudo_cpplint> + -DPSEUDO_CPPCHECK=$<TARGET_FILE:pseudo_cppcheck> ) set(want_NoQt_test FALSE) endif () |