Commit f8b94b8a authored by Alex Richardson's avatar Alex Richardson

Allow compiling without QtTest

parent 334b2a55
......@@ -24,10 +24,15 @@ find_package(Qt5 REQUIRED NO_MODULE
PrintSupport
Script
ScriptTools
Test
Widgets
Xml
OPTIONAL_COMPONENTS
Test
)
if (NOT Qt5Test_FOUND)
message(STATUS "Qt5Test not found, unit tests will not be built.")
endif()
find_package(KF5 CONFIG REQUIRED
COMPONENTS
......
if (NOT Qt5Test_FOUND)
return()
endif()
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
set( SUTDIR ${CMAKE_CURRENT_SOURCE_DIR}/../.. )
......
if (NOT Qt5Test_FOUND)
return()
endif()
include(ECMAddTests)
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
......
if (NOT Qt5Test_FOUND)
return()
endif()
include(ECMAddTests)
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
......
......@@ -448,44 +448,47 @@ set( OKTETA_KASTEN_CONTROLLERS_SRCS
${STRUCTVIEW_OTHER_SRCS}
)
#structures view unit tests
include(ECMAddTests)
#static lib for unit tests (reuse the OBJECT library)
add_library( structures-static STATIC ${PODDECODER_OBJS} ${STRUCTVIEW_OBJS} )
ecm_mark_as_test( structures-static )
target_link_libraries( structures-static
Qt5::Core
Qt5::Test
Qt5::Script
Qt5::Xml
KF5::I18n
KF5::Completion
KF5::ConfigWidgets
KF5::KCMUtils
${oktetakastencore_LIB}
${oktetakastengui_LIB}
${oktetacore_LIB}
${KASTENCORE_LIBS}
)
ecm_add_tests(
test/primitivearraytest.cpp
test/arraydatainformationtest.cpp
test/basicdatainformationtest.cpp
test/primitivedatainformationtest.cpp
test/scriptclassestest.cpp
test/uniondatainformationtest.cpp
test/allprimitivetypestest.cpp
test/scriptvalueconvertertest.cpp
test/osdparsertest.cpp
test/commonparsertest.cpp
test/jsparsertest.cpp
test/customtostringtest.cpp
test/locktooffsettest.cpp
NAME_PREFIX structures-
LINK_LIBRARIES structures-static
)
if (Qt5Test_FOUND)
#structures view unit tests
include(ECMAddTests)
#static lib for unit tests (reuse the OBJECT library)
add_library( structures-static STATIC ${PODDECODER_OBJS} ${STRUCTVIEW_OBJS} )
ecm_mark_as_test( structures-static )
target_link_libraries( structures-static
Qt5::Core
Qt5::Test
Qt5::Script
Qt5::Xml
KF5::I18n
KF5::Completion
KF5::ConfigWidgets
KF5::KCMUtils
${oktetakastencore_LIB}
${oktetakastengui_LIB}
${oktetacore_LIB}
${KASTENCORE_LIBS}
)
ecm_add_tests(
test/primitivearraytest.cpp
test/arraydatainformationtest.cpp
test/basicdatainformationtest.cpp
test/primitivedatainformationtest.cpp
test/scriptclassestest.cpp
test/uniondatainformationtest.cpp
test/allprimitivetypestest.cpp
test/scriptvalueconvertertest.cpp
test/osdparsertest.cpp
test/commonparsertest.cpp
test/jsparsertest.cpp
test/customtostringtest.cpp
test/locktooffsettest.cpp
NAME_PREFIX structures-
LINK_LIBRARIES structures-static
)
endif()
set( okteta_kastencontrollers_LIB_HDRS
${CMAKE_CURRENT_BINARY_DIR}/oktetakastencontrollers_export.h
......
if (NOT Qt5Test_FOUND)
return()
endif()
project( oktetakasten_document_tests )
include(ECMAddTests)
......
if (NOT Qt5Test_FOUND)
return()
endif()
project( oktetakasten_io_tests )
include(ECMAddTests)
......
if (NOT Qt5Test_FOUND)
return()
endif()
project( kasten_core_tests )
include(ECMAddTests)
......
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