Commit 1a9f7565 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Support BUILD_TESTING flag

parent 1f418b61
Pipeline #84767 passed with stage
in 4 minutes and 38 seconds
......@@ -39,6 +39,10 @@ include(GenerateExportHeader)
find_package(Boost "1.49" REQUIRED)
find_package(Grantlee5 "5.0.0" REQUIRED)
if(BUILD_TESTING)
set(QT_CONDITIONAL_COMPONENTS Test)
endif()
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
Core
Gui
......@@ -47,8 +51,8 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
Widgets
ScriptTools
Svg
Test
XmlPatterns
${QT_CONDITIONAL_COMPONENTS}
)
find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS
Archive
......
......@@ -102,6 +102,9 @@ ecm_optional_add_subdirectory(editorplugins)
ecm_optional_add_subdirectory(kernel)
ecm_optional_add_subdirectory(modifiers)
ecm_optional_add_subdirectory(qml)
ecm_optional_add_subdirectory(autotests)
ecm_optional_add_subdirectory(tests)
ecm_optional_add_subdirectory(modifiers/autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
ecm_optional_add_subdirectory(tests)
ecm_optional_add_subdirectory(modifiers/autotests)
endif()
......@@ -6,13 +6,6 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII)
include(ECMMarkAsTest)
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
if(NOT Qt5Test_FOUND)
message(STATUS "Qt5Test not found, autotests will not be built.")
return()
endif()
macro(GRAPHTHEORY_UNIT_TESTS)
foreach(_testname ${ARGN})
add_executable(${_testname} ${_testname}.cpp)
......
......@@ -17,4 +17,7 @@ target_link_libraries(assignvaluesplugin
)
kde_source_files_enable_exceptions(assignvalueswidget.cpp)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -23,4 +23,6 @@ target_link_libraries(generategraphplugin
KF5::Completion
)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -24,6 +24,8 @@ target_link_libraries(graphlayoutplugin
KF5::Completion
)
ecm_optional_add_subdirectory(autotests)
install(TARGETS graphlayoutplugin DESTINATION ${KDE_INSTALL_PLUGINDIR}/rocs/editorplugins)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -17,4 +17,6 @@ target_link_libraries(transformedgesplugin
KF5::Completion
)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -22,4 +22,6 @@ target_link_libraries(dotfileformat
rocsgraphtheory
)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -22,4 +22,6 @@ target_link_libraries(gmlfileformat
# Boost::spirit requires exceptions
kde_target_enable_exceptions(gmlfileformat PRIVATE)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -17,4 +17,6 @@ target_link_libraries(rocs1fileformat
rocsgraphtheory
)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -17,4 +17,6 @@ target_link_libraries(rocs2fileformat
rocsgraphtheory
)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -13,4 +13,6 @@ target_link_libraries(tgffileformat
rocsgraphtheory
)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -13,4 +13,6 @@ target_link_libraries(tikzfileformat
rocsgraphtheory
)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
......@@ -8,9 +8,11 @@ install(FILES modules/document/document.xml DESTINATION ${KDE_INSTALL_DATADIR}/r
install(FILES modules/document/node.xml DESTINATION ${KDE_INSTALL_DATADIR}/rocs/kernelapi)
install(FILES modules/document/edge.xml DESTINATION ${KDE_INSTALL_DATADIR}/rocs/kernelapi)
if(BUILD_TESTING)
# also copy all files for autotests
file(COPY kernelapi.xsd DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../autotests/kernelapi)
file(COPY modules/console/console.xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../autotests/kernelapi)
file(COPY modules/document/document.xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../autotests/kernelapi)
file(COPY modules/document/node.xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../autotests/kernelapi)
file(COPY modules/document/edge.xml DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../autotests/kernelapi)
endif()
......@@ -90,4 +90,7 @@ install(FILES rocsui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/rocs)
install(FILES rocs.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
ecm_optional_add_subdirectory(plugins/scriptapi)
ecm_optional_add_subdirectory(autotests)
if(BUILD_TESTING)
ecm_optional_add_subdirectory(autotests)
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment