Warning, /education/libkeduvocdocument/keduvocdocument/autotests/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # To add a new unittest 0002 # 1. Add its name to kvocdoc_unittests or kvocdoc_api_unittests 0003 0004 include(ECMMarkAsTest) 0005 include(ECMAddTests) 0006 include(CTest) 0007 0008 include_directories( 0009 ${CMAKE_CURRENT_BINARY_DIR}/.. 0010 ${CMAKE_CURRENT_SOURCE_DIR}/.. 0011 ../readerwriters 0012 ) 0013 0014 find_package(Qt${QT_MAJOR_VERSION} 5.2.0 CONFIG REQUIRED Test) 0015 0016 #API interface unit tests linked to exported shared library 0017 set(kvocdoc_api_unittests 0018 # keduvocdocumentvalidatortest 0019 # keduvocdocumentfilelockingtest 0020 # openAPItest 0021 keduvocdocumenttest.cpp 0022 emptydocumenttest.cpp 0023 keduvoctexttest.cpp 0024 ) 0025 0026 #Unit Tests linked to objects behind the API wall 0027 set(kvocdoc_unittests 0028 readerkvtml2test.cpp 0029 readerwordquiztest.cpp 0030 readerpaukertest.cpp 0031 readervokabelntest.cpp 0032 readerxdxftest.cpp 0033 ) 0034 0035 #Helper Clases for unit tests 0036 set(kvocdoc_unittests_helpers 0037 readerTestHelpers.h 0038 ) 0039 0040 0041 macro(KEDUVOCDOCUMENT_NON_GUI_UNIT_TESTS staticOrAPILib) 0042 foreach(_testname ${ARGN}) 0043 ecm_add_test( ${_testname} ${kvocdoc_unittests_helpers} 0044 LINK_LIBRARIES ${staticOrAPILib} KF${KF_MAJOR_VERSION}::CoreAddons KF${KF_MAJOR_VERSION}::KIOCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Xml 0045 TEST_NAME ${_testname} 0046 ) 0047 endforeach() 0048 endmacro() 0049 0050 macro(KEDUVOCDOCUMENT_GUI_UNIT_TESTS staticOrAPILib) 0051 foreach(_testname ${ARGN}) 0052 ecm_add_test( ${_testname} ${kvocdoc_unittests_helpers} 0053 LINK_LIBRARIES ${staticOrAPILib} KF${KF_MAJOR_VERSION}::CoreAddons KF${KF_MAJOR_VERSION}::KIOCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Xml 0054 TEST_NAME ${_testname} 0055 GUI) 0056 endforeach() 0057 endmacro() 0058 0059 macro(KEDUVOCDOCUMENT_GUI_UNIT_TESTS_STATIC staticOrAPILib) 0060 foreach(_testname ${ARGN}) 0061 ecm_add_test( ${_testname} ${kvocdoc_unittests_helpers} 0062 LINK_LIBRARIES ${staticOrAPILib} KF${KF_MAJOR_VERSION}::CoreAddons KF${KF_MAJOR_VERSION}::KIOCore Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Xml 0063 TEST_NAME ${_testname} 0064 GUI) 0065 set_target_properties(${_testname} PROPERTIES COMPILE_FLAGS -DKEDUVOCDOCUMENT_STATIC_DEFINE) 0066 endforeach() 0067 endmacro() 0068 0069 0070 keduvocdocument_non_gui_unit_tests(KEduVocDocument ${kvocdoc_api_unittests}) 0071 keduvocdocument_gui_unit_tests_static(keduvocdocument_static ${kvocdoc_unittests})