|
Line 0
Link Here
|
|
|
1 |
################################################# |
| 2 |
# |
| 3 |
# (C) 2016 Emanoil Kotsev |
| 4 |
# emanoil (DOT) kotsev (AT) fincom.at |
| 5 |
# |
| 6 |
# (C) 2016 Slávek Banko |
| 7 |
# slavek (DOT) banko (AT) axis.cz |
| 8 |
# |
| 9 |
# Improvements and feedback are welcome |
| 10 |
# |
| 11 |
# This file is released under GPL >= 2 |
| 12 |
# |
| 13 |
################################################# |
| 14 |
|
| 15 |
include_directories( |
| 16 |
${CMAKE_CURRENT_BINARY_DIR} |
| 17 |
${CMAKE_BINARY_DIR} |
| 18 |
${CMAKE_SOURCE_DIR} |
| 19 |
${CMAKE_SOURCE_DIR}/libtdepim |
| 20 |
${CMAKE_BINARY_DIR}/libkcal |
| 21 |
${CMAKE_SOURCE_DIR}/libkcal |
| 22 |
${TDE_INCLUDE_DIR} |
| 23 |
${TQT_INCLUDE_DIRS} |
| 24 |
${LIBICAL_INCLUDE_DIRS} |
| 25 |
) |
| 26 |
|
| 27 |
link_directories( |
| 28 |
${TQT_LIBRARY_DIRS} |
| 29 |
) |
| 30 |
|
| 31 |
set( TDEABC_TESTS_LINK |
| 32 |
${TQT_LIBRARIES} |
| 33 |
DCOP-shared |
| 34 |
tdecore-shared |
| 35 |
tdeui-shared |
| 36 |
tdefx-shared |
| 37 |
tdeio-shared |
| 38 |
tdetexteditor-shared |
| 39 |
kcal-shared |
| 40 |
) |
| 41 |
|
| 42 |
|
| 43 |
##### test programs ############################## |
| 44 |
|
| 45 |
tde_add_executable( testincidence |
| 46 |
SOURCES testincidence.cpp AUTOMOC |
| 47 |
LINK ${TDEABC_TESTS_LINK} |
| 48 |
) |
| 49 |
|
| 50 |
tde_add_executable( testcalendar |
| 51 |
SOURCES testcalendar.cpp AUTOMOC |
| 52 |
LINK ${TDEABC_TESTS_LINK} |
| 53 |
) |
| 54 |
|
| 55 |
tde_add_executable( testtostring |
| 56 |
SOURCES testtostring.cpp AUTOMOC |
| 57 |
LINK ${TDEABC_TESTS_LINK} |
| 58 |
) |
| 59 |
|
| 60 |
tde_add_executable( fbrecurring |
| 61 |
SOURCES fbrecurring.cpp AUTOMOC |
| 62 |
LINK ${TDEABC_TESTS_LINK} |
| 63 |
) |
| 64 |
|
| 65 |
tde_add_executable( readandwrite |
| 66 |
SOURCES readandwrite.cpp AUTOMOC |
| 67 |
LINK ${TDEABC_TESTS_LINK} |
| 68 |
) |
| 69 |
set_property( |
| 70 |
TARGET readandwrite |
| 71 |
APPEND PROPERTY COMPILE_DEFINITIONS |
| 72 |
KDETOPSRCDIR="${CMAKE_SOURCE_DIR}" |
| 73 |
) |
| 74 |
|
| 75 |
tde_add_executable( testresource |
| 76 |
SOURCES testresource.cpp AUTOMOC |
| 77 |
LINK ${TDEABC_TESTS_LINK} |
| 78 |
) |
| 79 |
|
| 80 |
tde_add_executable( testrecurrence |
| 81 |
SOURCES testrecurrence.cpp AUTOMOC |
| 82 |
LINK ${TDEABC_TESTS_LINK} |
| 83 |
) |
| 84 |
set_property( |
| 85 |
TARGET testrecurrence |
| 86 |
APPEND PROPERTY COMPILE_DEFINITIONS |
| 87 |
KDETOPSRCDIR="${CMAKE_SOURCE_DIR}" |
| 88 |
) |
| 89 |
|
| 90 |
tde_add_executable( testrecurprevious |
| 91 |
SOURCES testrecurprevious.cpp AUTOMOC |
| 92 |
LINK ${TDEABC_TESTS_LINK} |
| 93 |
) |
| 94 |
set_property( |
| 95 |
TARGET testrecurprevious |
| 96 |
APPEND PROPERTY COMPILE_DEFINITIONS |
| 97 |
KDETOPSRCDIR="${CMAKE_SOURCE_DIR}" |
| 98 |
) |
| 99 |
|
| 100 |
tde_add_executable( testrecurson |
| 101 |
SOURCES testrecurson.cpp AUTOMOC |
| 102 |
LINK ${TDEABC_TESTS_LINK} |
| 103 |
) |
| 104 |
set_property( |
| 105 |
TARGET testrecurson |
| 106 |
APPEND PROPERTY COMPILE_DEFINITIONS |
| 107 |
KDETOPSRCDIR="${CMAKE_SOURCE_DIR}" |
| 108 |
) |
| 109 |
|
| 110 |
tde_add_executable( testrecurrencetype |
| 111 |
SOURCES testrecurrencetype.cpp AUTOMOC |
| 112 |
LINK ${TDEABC_TESTS_LINK} |
| 113 |
) |
| 114 |
set_property( |
| 115 |
TARGET testrecurrencetype |
| 116 |
APPEND PROPERTY COMPILE_DEFINITIONS |
| 117 |
KDETOPSRCDIR="${CMAKE_SOURCE_DIR}" |
| 118 |
) |
| 119 |
|
| 120 |
tde_add_executable( testvcalexport |
| 121 |
SOURCES testvcalexport.cpp AUTOMOC |
| 122 |
LINK ${TDEABC_TESTS_LINK} |
| 123 |
) |
| 124 |
set_property( |
| 125 |
TARGET testvcalexport |
| 126 |
APPEND PROPERTY COMPILE_DEFINITIONS |
| 127 |
KDETOPSRCDIR="${CMAKE_SOURCE_DIR}" |
| 128 |
) |
| 129 |
|
| 130 |
tde_add_executable( testfields |
| 131 |
SOURCES testfields.cpp AUTOMOC |
| 132 |
LINK ${TDEABC_TESTS_LINK} |
| 133 |
) |
| 134 |
set_property( |
| 135 |
TARGET testfields |
| 136 |
APPEND PROPERTY COMPILE_DEFINITIONS |
| 137 |
INPUT="${CMAKE_CURRENT_SOURCE_DIR}/data/test_pilot.ics" |
| 138 |
) |
| 139 |
|
| 140 |
tde_add_executable( testfb |
| 141 |
SOURCES testfb.cpp AUTOMOC |
| 142 |
LINK ${TDEABC_TESTS_LINK} |
| 143 |
) |
| 144 |
|
| 145 |
tde_add_executable( testcalselectdialog |
| 146 |
SOURCES testcalselectdialog.cpp AUTOMOC |
| 147 |
LINK ${TDEABC_TESTS_LINK} |
| 148 |
) |
| 149 |
|
| 150 |
|
| 151 |
##### perform tests ############################## |
| 152 |
|
| 153 |
add_custom_target( libkcal_tests ALL |
| 154 |
COMMENT "[libkcal] Performing tests" |
| 155 |
COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/FAILED |
| 156 |
DEPENDS |
| 157 |
testincidence testcalendar testtostring fbrecurring |
| 158 |
readandwrite testresource testrecurrence testrecurprevious |
| 159 |
testrecurson testrecurrencetype testvcalexport testfields |
| 160 |
testfb testcalselectdialog |
| 161 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
| 162 |
) |
| 163 |
|
| 164 |
|
| 165 |
file( GLOB libkcal_test_recurrence "data/RecurrenceRule/*/*.ics" ) |
| 166 |
list( SORT libkcal_test_recurrence ) |
| 167 |
|
| 168 |
foreach(testfile ${libkcal_test_recurrence}) |
| 169 |
add_custom_command( |
| 170 |
TARGET libkcal_tests |
| 171 |
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl testrecurrence "next" ${testfile} |
| 172 |
) |
| 173 |
endforeach(testfile) |
| 174 |
|
| 175 |
foreach(testfile ${libkcal_test_recurrence}) |
| 176 |
add_custom_command( |
| 177 |
TARGET libkcal_tests |
| 178 |
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl testrecurprevious "prev" ${testfile} |
| 179 |
) |
| 180 |
endforeach(testfile) |
| 181 |
|
| 182 |
foreach(testfile ${libkcal_test_recurrence}) |
| 183 |
add_custom_command( |
| 184 |
TARGET libkcal_tests |
| 185 |
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl testrecurson "recurson" ${testfile} |
| 186 |
) |
| 187 |
endforeach(testfile) |
| 188 |
|
| 189 |
|
| 190 |
file( GLOB libkcal_test_compat "data/Compat/*.ics" ) |
| 191 |
list( SORT libkcal_test_compat ) |
| 192 |
|
| 193 |
foreach(testfile ${libkcal_test_compat}) |
| 194 |
add_custom_command( |
| 195 |
TARGET libkcal_tests |
| 196 |
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl readandwrite "ical" ${testfile} |
| 197 |
) |
| 198 |
endforeach(testfile) |
| 199 |
|
| 200 |
|
| 201 |
file( GLOB libkcal_test_vcalendar_ics "data/vCalendar/*.ics" ) |
| 202 |
list( SORT libkcal_test_vcalendar_ics ) |
| 203 |
|
| 204 |
foreach(testfile ${libkcal_test_vcalendar_ics}) |
| 205 |
add_custom_command( |
| 206 |
TARGET libkcal_tests |
| 207 |
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl testvcalexport "vcal" ${testfile} |
| 208 |
) |
| 209 |
endforeach(testfile) |
| 210 |
|
| 211 |
|
| 212 |
file( GLOB libkcal_test_vcalendar_vcs "data/vCalendar/*.vcs" ) |
| 213 |
list( SORT libkcal_test_vcalendar_vcs ) |
| 214 |
|
| 215 |
foreach(testfile ${libkcal_test_vcalendar_vcs}) |
| 216 |
add_custom_command( |
| 217 |
TARGET libkcal_tests |
| 218 |
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl readandwrite "ical" ${testfile} |
| 219 |
) |
| 220 |
endforeach(testfile) |
| 221 |
|
| 222 |
|
| 223 |
add_custom_command( |
| 224 |
TARGET libkcal_tests |
| 225 |
COMMAND test ! -f ${CMAKE_CURRENT_BINARY_DIR}/FAILED |
| 226 |
) |