diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-03-24 21:35:42 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-04-01 18:36:29 +0200 |
commit | 77ffd0e710a5ea62b3c36e37cf82fd66df5b6512 (patch) | |
tree | 8ca132ac10b901c26da56102c75c5df3edd52ab8 /libkcal/tests/CMakeLists.txt | |
parent | 53ce57b0434d4fd42b3128a8f9fb4076e406ce01 (diff) | |
download | tdepim-77ffd0e710a5ea62b3c36e37cf82fd66df5b6512.tar.gz tdepim-77ffd0e710a5ea62b3c36e37cf82fd66df5b6512.zip |
Fixed building of libkcal tests. Some of the tests still fails when
executed. This relates to bug 2719.
Special thanks to Emanoil Kotsev <deloptes@gmail.com> for providing an
inital patch for the same bug, from which I reused a small section of code.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit ce47e20ed3f172bb04a2d4055a9326fec1c879b0)
Diffstat (limited to 'libkcal/tests/CMakeLists.txt')
-rw-r--r-- | libkcal/tests/CMakeLists.txt | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/libkcal/tests/CMakeLists.txt b/libkcal/tests/CMakeLists.txt new file mode 100644 index 000000000..386982c4d --- /dev/null +++ b/libkcal/tests/CMakeLists.txt @@ -0,0 +1,82 @@ +################################################# +# +# (C) 2019 Michele Calgaro +# michele (DOT) calgaro (AT) yahoo (DOT) it +# +# Improvements and feedbacks are welcome +# +# This file is released under GPL >= 3 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/libkcal + ${CMAKE_SOURCE_DIR}/libtdepim +) + +set( _link_libkcal_tests + ${TQT_LIBRARIES} + DCOP-shared + tdecore-shared + tdeui-shared + tdefx-shared + tdeio-shared + tdetexteditor-shared + kcal-shared +) + + +### executable files + +set( _test_executables + fbrecurring readandwrite testcalendar testcalselectdialog testfb testfields testincidence testrecurprevious + testrecurrence testrecurrencetype testrecurson testresource testtostring testvcalexport +) + +foreach( _test_name ${_test_executables} ) + tde_add_check_executable( ${_test_name} + SOURCES ${_test_name}.cpp AUTOMOC + LINK ${_link_libkcal_tests} + ) +endforeach( ) + +set_target_properties( testfields + PROPERTIES COMPILE_FLAGS -DINPUT='\"${CMAKE_CURRENT_SOURCE_DIR}/data/test_pilot.ics\"' +) + + +### tests + +add_custom_command( + TARGET fbrecurring PRE_BUILD + COMMAND test -d data || cp -vr ${CMAKE_CURRENT_SOURCE_DIR}/data data + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) + +set ( _test1 testrecurrence "next" ${CMAKE_CURRENT_SOURCE_DIR}/data/RecurrenceRule/*.ics ) +set ( _test2 testrecurprevious "prev" ${CMAKE_CURRENT_SOURCE_DIR}/data/RecurrenceRule/*.ics ) +set ( _test3 testrecurson "recurson" ${CMAKE_CURRENT_SOURCE_DIR}/data/RecurrenceRule/*.ics ) +set ( _test4 readandwrite "ical" ${CMAKE_CURRENT_SOURCE_DIR}/data/Compat/*.ics ) +set ( _test5 testvcalexport "vcal" ${CMAKE_CURRENT_SOURCE_DIR}/data/vCalendar/*.ics ) +set ( _test6 readandwrite "ical" ${CMAKE_CURRENT_SOURCE_DIR}/data/vCalendar/*.vcs ) +set ( _all_tests _test1 _test2 _test3 _test4 _test5 _test6 ) + +foreach( _test_name ${_all_tests} ) + list( GET ${_test_name} 0 _test_executable ) + list( GET ${_test_name} 1 _test_id ) + list( GET ${_test_name} 2 _test_search_filter ) + file( GLOB_RECURSE _test_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_test_search_filter} ) + foreach( _test_file ${_test_files} ) + add_test( + ${_test_executable}__${_test_file}__ + ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl ${_test_executable} ${_test_id} ${CMAKE_CURRENT_BINARY_DIR}/${_test_file} + ) + endforeach( ) +endforeach( ) + |