File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ option(ENABLE_OSS_FUZZ "Enable the OSS-Fuzz related targets"
3939option (BUILD_GUI "Build the qt application" OFF )
4040option (WITH_QCHART "Enable QtCharts usage in the GUI" OFF )
4141option (USE_QT6 "Prefer Qt6 when available" OFF )
42+ option (REGISTER_GUI_TESTS "Register GUI tests in CTest" ON )
4243
4344option (HAVE_RULES "Usage of rules (needs PCRE library and headers)" OFF )
4445option (USE_BUNDLED_TINYXML2 "Usage of bundled tinyxml2 library" ON )
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ message( STATUS "ENABLE_OSS_FUZZ = ${ENABLE_OSS_FUZZ}" )
4848message ( STATUS )
4949message ( STATUS "BUILD_GUI = ${BUILD_GUI} " )
5050if (BUILD_GUI)
51+ message ( STATUS "REGISTER_GUI_TESTS = ${REGISTER_GUI_TESTS} " )
5152 message ( STATUS "WITH_QCHART = ${WITH_QCHART} " )
5253 message ( STATUS "USE_QT6 = ${USE_QT6} " )
5354 message ( STATUS "QT_VERSION = ${QT_VERSION} " )
Original file line number Diff line number Diff line change @@ -14,4 +14,8 @@ target_link_libraries(test-cppchecklibrarydata ${QT_CORE_LIB} ${QT_TEST_LIB})
1414if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
1515 # Q_UNUSED() in generated code
1616 target_compile_options_safe (test -cppchecklibrarydata -Wno-extra-semi-stmt )
17+ endif ()
18+
19+ if (REGISTER_GUI_TESTS)
20+ add_test (NAME test -cppchecklibrarydata COMMAND $<TARGET_FILE :test -cppchecklibrarydata >)
1721endif ()
Original file line number Diff line number Diff line change @@ -17,4 +17,9 @@ target_link_libraries(test-filelist ${QT_CORE_LIB} ${QT_TEST_LIB})
1717if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
1818 # Q_UNUSED() in generated code
1919 target_compile_options_safe (test -filelist -Wno-extra-semi-stmt )
20+ endif ()
21+
22+ if (REGISTER_GUI_TESTS)
23+ # TODO: requires X session
24+ #add_test(NAME test-filelist COMMAND $<TARGET_FILE:test-filelist>)
2025endif ()
Original file line number Diff line number Diff line change @@ -13,4 +13,8 @@ target_link_libraries(test-projectfile ${QT_CORE_LIB} ${QT_TEST_LIB})
1313if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
1414 # Q_UNUSED() in generated code
1515 target_compile_options_safe (test -projectfile -Wno-extra-semi-stmt )
16+ endif ()
17+
18+ if (REGISTER_GUI_TESTS)
19+ add_test (NAME test -projectfile COMMAND $<TARGET_FILE :test -projectfile >)
1620endif ()
Original file line number Diff line number Diff line change @@ -12,5 +12,10 @@ target_link_libraries(test-translationhandler ${QT_CORE_LIB} ${QT_WIDGETS_LIB} $
1212
1313if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
1414 # Q_UNUSED() in generated code
15- target_compile_options_safe (test -projectfile -Wno-extra-semi-stmt )
15+ target_compile_options_safe (test -translationhandler -Wno-extra-semi-stmt )
16+ endif ()
17+
18+ if (REGISTER_GUI_TESTS)
19+ # TODO: requires X session
20+ #add_test(NAME test-translationhandler COMMAND $<TARGET_FILE:test-translationhandler>)
1621endif ()
Original file line number Diff line number Diff line change @@ -23,3 +23,8 @@ endif()
2323if (tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
2424 target_link_libraries (test -xmlreportv2 ${tinyxml2_LIBRARIES} )
2525endif ()
26+
27+ if (REGISTER_GUI_TESTS)
28+ # TODO: requires X session
29+ #add_test(NAME test-xmlreportv2 COMMAND $<TARGET_FILE:test-xmlreportv2>)
30+ endif ()
You can’t perform that action at this time.
0 commit comments