CMakeLists.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. set(KIT ${PROJECT_NAME})
  2. set(TEST_SOURCES
  3. ctkActionsWidgetTest1.cpp
  4. ctkAddRemoveComboBoxTest1.cpp
  5. ctkAxesWidgetTest1.cpp
  6. ctkButtonGroupTest1.cpp
  7. ctkCheckBoxPixmapsTest1.cpp
  8. ctkCheckBoxTest1.cpp
  9. ctkCheckableComboBoxTest1.cpp
  10. ctkCheckableHeaderViewTest1.cpp
  11. ctkCheckableHeaderViewTest2.cpp
  12. ctkCheckableModelHelperTest2.cpp
  13. ctkCheckablePushButtonTest1.cpp
  14. ctkCollapsibleButtonTest1.cpp
  15. ctkCollapsibleButtonTest2.cpp
  16. ctkCollapsibleGroupBoxTest1.cpp
  17. ctkColorDialogTest1.cpp
  18. ctkColorDialogTest2.cpp
  19. ctkColorPickerButtonTest1.cpp
  20. ctkComboBoxTest1.cpp
  21. ctkCompleterTest1.cpp
  22. ctkConsoleTest1.cpp
  23. ctkCoordinatesWidgetTest.cpp
  24. ctkCoordinatesWidgetTest1.cpp
  25. ctkCrosshairLabelTest1.cpp
  26. ctkDirectoryButtonTest1.cpp
  27. ctkDoubleRangeSliderTest1.cpp
  28. ctkDoubleRangeSliderTest2.cpp
  29. ctkDoubleSliderTest1.cpp
  30. ctkDoubleSliderTest2.cpp
  31. ctkDynamicSpacerTest1.cpp
  32. ctkDynamicSpacerTest2.cpp
  33. ctkErrorLogWidgetTest1.cpp
  34. ctkExpandButtonTest1.cpp
  35. ctkFileDialogTest1.cpp
  36. ctkFlatProxyModelTest.cpp
  37. ctkFittedTextBrowserTest1.cpp
  38. ctkFlowLayoutTest1.cpp
  39. ctkFontButtonTest.cpp
  40. ctkLayoutManagerTest1.cpp
  41. ctkMaterialPropertyPreviewLabelTest1.cpp
  42. ctkMaterialPropertyWidgetTest1.cpp
  43. ctkMaterialPropertyWidgetTest2.cpp
  44. ctkMatrixWidgetTest1.cpp
  45. ctkMatrixWidgetTest2.cpp
  46. ctkMenuButtonTest1.cpp
  47. ctkMenuComboBoxTest1.cpp
  48. ctkMenuComboBoxTest2.cpp
  49. ctkMenuComboBoxTest3.cpp
  50. ctkMessageBoxDontShowAgainTest.cpp
  51. ctkModalityWidgetTest1.cpp
  52. ctkPathLineEditTest1.cpp
  53. ctkPathListWidgetTest.cpp
  54. ctkPathListWidgetWithButtonsTest.cpp
  55. ctkPopupWidgetTest1.cpp
  56. ctkRangeSliderTest.cpp
  57. ctkRangeSliderTest1.cpp
  58. ctkRangeWidgetTest1.cpp
  59. ctkRangeWidgetTest2.cpp
  60. ctkDateRangeWidgetTest1.cpp
  61. ctkScreenshotDialogTest1.cpp
  62. ctkSearchBoxTest1.cpp
  63. ctkSearchBoxTest2.cpp
  64. ctkSettingsPanelTest.cpp
  65. ctkSettingsPanelTest1.cpp
  66. ctkSettingsTest1.cpp
  67. ctkSettingsDialogTest1.cpp
  68. ctkSignalMapperTest1.cpp
  69. ctkSliderWidgetTest1.cpp
  70. ctkSliderWidgetTest2.cpp
  71. ctkThumbnailListWidgetTest1.cpp
  72. ctkThumbnailLabelTest1.cpp
  73. ctkToolTipTrapperTest1.cpp
  74. ctkTreeComboBoxTest1.cpp
  75. ctkWidgetsUtilsTest1.cpp
  76. ctkWidgetsUtilsTestGrabWidget.cpp
  77. ctkWorkflowWidgetTest1.cpp
  78. ctkWorkflowWidgetTest2.cpp
  79. ctkExampleUseOfWorkflowWidgetUsingDerivedSteps.cpp
  80. ctkExampleUseOfWorkflowWidgetUsingSignalsAndSlots.cpp
  81. )
  82. #
  83. # Tests expecting CTKData to be set
  84. #
  85. if(EXISTS "${CTKData_DIR}")
  86. list(APPEND TEST_SOURCES
  87. ctkCrosshairLabelTest2.cpp
  88. )
  89. endif()
  90. include_directories(${CMAKE_SOURCE_DIR}/Libs/Testing
  91. ${CMAKE_CURRENT_BINARY_DIR})
  92. if(CTK_USE_QTTESTING)
  93. list(APPEND TEST_SOURCES
  94. ctkActionsWidgetEventTranslatorPlayerTest1.cpp
  95. ctkAddRemoveComboBoxEventTranslatorPlayerTest1.cpp
  96. ctkAxesWidgetEventTranslatorPlayerTest1.cpp
  97. ctkButtonGroupEventTranslatorPlayerTest1.cpp
  98. ctkCheckableComboBoxEventTranslatorPlayerTest1.cpp
  99. ctkCheckableHeaderViewEventTranslatorPlayerTest1.cpp
  100. ctkCheckablePushButtonEventTranslatorPlayerTest1.cpp
  101. ctkCollapsibleButtonEventTranslatorPlayerTest1.cpp
  102. ctkCollapsibleGroupBoxEventTranslatorPlayerTest1.cpp
  103. ctkColorDialogEventTranslatorPlayerTest1.cpp
  104. ctkColorPickerButtonEventTranslatorPlayerTest1.cpp
  105. ctkComboBoxEventTranslatorPlayerTest1.cpp
  106. ctkConsoleEventTranslatorPlayerTest1.cpp
  107. ctkCoordinatesWidgetEventTranslatorPlayerTest1.cpp
  108. # ctkDateRangeWidgetEventTranslatorPlayerTest1.cpp
  109. ctkDirectoryButtonEventTranslatorPlayerTest1.cpp
  110. ctkDoubleRangeSliderEventTranslatorPlayerTest1.cpp
  111. ctkDoubleSliderEventTranslatorPlayerTest1.cpp
  112. ctkExpandButtonEventTranslatorPlayerTest1.cpp
  113. ctkFileDialogEventTranslatorPlayerTest1.cpp
  114. ctkFontButtonEventTranslatorPlayerTest1.cpp
  115. ctkMaterialPropertyWidgetEventTranslatorPlayerTest1.cpp
  116. ctkMatrixWidgetEventTranslatorPlayerTest1.cpp
  117. ctkMenuButtonEventTranslatorPlayerTest1.cpp
  118. ctkMenuEventTranslatorPlayerTest1.cpp
  119. ctkMenuComboBoxEventTranslatorPlayerTest1.cpp
  120. ctkModalityWidgetEventTranslatorPlayerTest1.cpp
  121. ctkPathLineEditEventTranslatorPlayerTest1.cpp
  122. ctkPopupWidgetEventTranslatorPlayerTest1.cpp
  123. ctkRangeSliderEventTranslatorPlayerTest1.cpp
  124. ctkRangeWidgetEventTranslatorPlayerTest1.cpp
  125. # ctkScreenshotDialogEventTranslatorPlayerTest1.cpp
  126. ctkSearchBoxEventTranslatorPlayerTest1.cpp
  127. ctkSettingsDialogEventTranslatorPlayerTest1.cpp
  128. ctkSliderWidgetEventTranslatorPlayerTest1.cpp
  129. ctkTreeComboBoxEventTranslatorPlayerTest1.cpp
  130. # ctkWorkflowAbstractPagedWidgetEventTranslatorPlayerTest1.cpp
  131. # ctkWorkflowButtonBoxWidgetEventTranslatorPlayerTest1.cpp
  132. # ctkWorkflowGroupBoxEventTranslatorPlayerTest1.cpp
  133. # ctkWorkflowStackedWidgetEventTranslatorPlayerTest1.cpp
  134. # ctkWorkflowTabWidgetEventTranslatorPlayerTest1.cpp
  135. # ctkWorkflowWidgetEventTranslatorPlayerTest1.cpp
  136. # ctkWorkflowWidgetStepEventTranslatorPlayerTest1.cpp
  137. )
  138. endif()
  139. create_test_sourcelist(Tests ${KIT}CppTests.cxx
  140. ${TEST_SOURCES}
  141. )
  142. set(TestsToRun ${Tests})
  143. remove(TestsToRun ${KIT}CppTests.cxx)
  144. set(LIBRARY_NAME ${PROJECT_NAME})
  145. set(Tests_SRCS
  146. ctkExampleDerivedWorkflowWidgetStep.cpp
  147. ctkExampleDerivedWorkflowWidgetStep.h
  148. ctkExampleWorkflowWidgetStepUsingSignalsAndSlots.cpp
  149. ctkExampleWorkflowWidgetStepUsingSignalsAndSlots.h
  150. ctkSettingsPanelTest2Helper.cpp
  151. ctkSettingsPanelTest2Helper.h
  152. )
  153. set(Tests_MOC_SRCS
  154. ctkExampleDerivedWorkflowWidgetStep.h
  155. ctkExampleWorkflowWidgetStepUsingSignalsAndSlots.h
  156. ctkSettingsPanelTest2Helper.h
  157. )
  158. if(CTK_USE_QTTESTING)
  159. ctkQtTesting(Tests_SRCS Tests_MOC_SRCS Tests_UI_FORMS Tests_RESOURCES)
  160. endif()
  161. set(Tests_MOC_CPP)
  162. QT4_WRAP_CPP(Tests_MOC_CPP ${Tests_MOC_SRCS})
  163. QT4_GENERATE_MOCS(
  164. ctkCoordinatesWidgetTest.cpp
  165. ctkFlatProxyModelTest.cpp
  166. ctkFontButtonTest.cpp
  167. ctkMessageBoxDontShowAgainTest.cpp
  168. ctkPathListWidgetTest.cpp
  169. ctkPathListWidgetWithButtonsTest.cpp
  170. ctkRangeSliderTest.cpp
  171. ctkSettingsPanelTest.cpp
  172. )
  173. set(Tests_UI_CPP)
  174. if(TEST_UI_FORMS)
  175. QT4_WRAP_UI(Tests_UI_CPP ${Tests_UI_FORMS})
  176. endif()
  177. set(Tests_RESOURCES_SRCS)
  178. QT4_ADD_RESOURCES(Tests_RESOURCES_SRCS ${Tests_RESOURCES})
  179. add_executable(${KIT}CppTests ${Tests} ${Tests_SRCS} ${Tests_MOC_CPP} ${Tests_UI_CPP} ${Tests_RESOURCES_SRCS})
  180. target_link_libraries(${KIT}CppTests ${LIBRARY_NAME})
  181. #
  182. # Add Tests
  183. #
  184. SIMPLE_TEST( ctkActionsWidgetTest1 )
  185. SIMPLE_TEST( ctkAddRemoveComboBoxTest1 )
  186. SIMPLE_TEST( ctkAxesWidgetTest1 )
  187. SIMPLE_TEST( ctkButtonGroupTest1 )
  188. SIMPLE_TEST( ctkCheckBoxPixmapsTest1 )
  189. SIMPLE_TEST( ctkCheckBoxTest1 )
  190. SIMPLE_TEST( ctkCheckableComboBoxTest1 )
  191. SIMPLE_TEST( ctkCheckableHeaderViewTest1 )
  192. SIMPLE_TEST( ctkCheckableHeaderViewTest2 )
  193. SIMPLE_TEST( ctkCheckableModelHelperTest2 )
  194. SIMPLE_TEST( ctkCheckablePushButtonTest1 )
  195. SIMPLE_TEST( ctkCollapsibleButtonTest1 )
  196. SIMPLE_TEST( ctkCollapsibleButtonTest2 )
  197. SIMPLE_TEST( ctkCollapsibleGroupBoxTest1 )
  198. SIMPLE_TEST( ctkColorDialogTest1 )
  199. SIMPLE_TEST( ctkColorDialogTest2 )
  200. SIMPLE_TEST( ctkColorPickerButtonTest1 )
  201. SIMPLE_TEST( ctkComboBoxTest1 )
  202. SIMPLE_TEST( ctkCompleterTest1 )
  203. SIMPLE_TEST( ctkConsoleTest1 )
  204. SIMPLE_TEST( ctkCoordinatesWidgetTest )
  205. SIMPLE_TEST( ctkCoordinatesWidgetTest1 )
  206. SIMPLE_TEST( ctkCrosshairLabelTest1 )
  207. SIMPLE_TEST( ctkDateRangeWidgetTest1 )
  208. SIMPLE_TEST( ctkDirectoryButtonTest1 )
  209. SIMPLE_TEST( ctkDoubleRangeSliderTest1 )
  210. SIMPLE_TEST( ctkDoubleRangeSliderTest2 )
  211. SIMPLE_TEST( ctkDoubleSliderTest1 )
  212. SIMPLE_TEST( ctkDoubleSliderTest2 )
  213. SIMPLE_TEST( ctkDynamicSpacerTest1 )
  214. SIMPLE_TEST( ctkDynamicSpacerTest2 )
  215. SIMPLE_TEST( ctkErrorLogWidgetTest1 )
  216. SIMPLE_TEST( ctkExampleUseOfWorkflowWidgetUsingDerivedSteps )
  217. SIMPLE_TEST( ctkExampleUseOfWorkflowWidgetUsingSignalsAndSlots )
  218. SIMPLE_TEST( ctkExpandButtonTestQSpinBox issue if used1 )
  219. SIMPLE_TEST( ctkFlatProxyModelTest )
  220. SIMPLE_TEST( ctkFileDialogTest1 )
  221. SIMPLE_TEST( ctkFittedTextBrowserTest1 )
  222. SIMPLE_TEST( ctkFlowLayoutTest1 )
  223. SIMPLE_TEST( ctkFontButtonTest )
  224. SIMPLE_TEST( ctkLayoutManagerTest1 )
  225. SIMPLE_TEST( ctkMaterialPropertyPreviewLabelTest1 )
  226. SIMPLE_TEST( ctkMaterialPropertyWidgetTest1 )
  227. SIMPLE_TEST( ctkMaterialPropertyWidgetTest2 )
  228. SIMPLE_TEST( ctkMatrixWidgetTest1 )
  229. SIMPLE_TEST( ctkMatrixWidgetTest2 )
  230. SIMPLE_TEST( ctkMenuButtonTest1 )
  231. SIMPLE_TEST( ctkMenuComboBoxTest1 )
  232. SIMPLE_TEST( ctkMenuComboBoxTest2 )
  233. SIMPLE_TEST( ctkMenuComboBoxTest3 )
  234. SIMPLE_TEST( ctkMessageBoxDontShowAgainTest )
  235. SIMPLE_TEST( ctkModalityWidgetTest1 )
  236. SIMPLE_TEST( ctkPathLineEditTest1 )
  237. SIMPLE_TEST( ctkPathListWidgetTest )
  238. SIMPLE_TEST( ctkPathListWidgetWithButtonsTest )
  239. SIMPLE_TEST( ctkPopupWidgetTest1 )
  240. SIMPLE_TEST( ctkRangeSliderTest )
  241. SIMPLE_TEST( ctkRangeSliderTest1 )
  242. SIMPLE_TEST( ctkRangeWidgetTest1 )
  243. SIMPLE_TEST( ctkRangeWidgetTest2 )
  244. SIMPLE_TEST( ctkScreenshotDialogTest1 )
  245. SIMPLE_TEST( ctkSearchBoxTest1 )
  246. SIMPLE_TEST( ctkSearchBoxTest2 )
  247. SIMPLE_TEST( ctkSettingsDialogTest1 )
  248. SIMPLE_TEST( ctkSettingsPanelTest )
  249. SIMPLE_TEST( ctkSettingsPanelTest1 )
  250. SIMPLE_TEST( ctkSettingsTest1 )
  251. SIMPLE_TEST( ctkSignalMapperTest1 )
  252. SIMPLE_TEST( ctkSliderWidgetTest1 )
  253. SIMPLE_TEST( ctkSliderWidgetTest2 )
  254. SIMPLE_TEST( ctkThumbnailListWidgetTest1 )
  255. SIMPLE_TEST( ctkThumbnailLabelTest1 )
  256. SIMPLE_TEST( ctkToolTipTrapperTest1 )
  257. SIMPLE_TEST( ctkTreeComboBoxTest1 )
  258. SIMPLE_TEST( ctkWidgetsUtilsTest1 )
  259. SIMPLE_TEST( ctkWidgetsUtilsTestGrabWidget )
  260. SIMPLE_TEST( ctkWorkflowWidgetTest1 )
  261. SIMPLE_TEST( ctkWorkflowWidgetTest2 )
  262. #
  263. # Add Tests expecting CTKData to be set
  264. #
  265. if(EXISTS "${CTKData_DIR}")
  266. set(baseline_relative_location "Libs/Widgets")
  267. SIMPLE_TEST_WITH_DATA( ctkCrosshairLabelTest2 ${baseline_relative_location})
  268. endif()
  269. # Add Tests expecting CTK_USE_QTTESTING to be set
  270. #
  271. if(CTK_USE_QTTESTING)
  272. SIMPLE_TEST( ctkActionsWidgetEventTranslatorPlayerTest1 )
  273. SIMPLE_TEST( ctkAddRemoveComboBoxEventTranslatorPlayerTest1 )
  274. SIMPLE_TEST( ctkAxesWidgetEventTranslatorPlayerTest1 )
  275. SIMPLE_TEST( ctkButtonGroupEventTranslatorPlayerTest1 )
  276. SIMPLE_TEST( ctkCheckableComboBoxEventTranslatorPlayerTest1 )
  277. SIMPLE_TEST( ctkCheckableHeaderViewEventTranslatorPlayerTest1 )
  278. SIMPLE_TEST( ctkCheckablePushButtonEventTranslatorPlayerTest1 )
  279. SIMPLE_TEST( ctkCollapsibleButtonEventTranslatorPlayerTest1 )
  280. SIMPLE_TEST( ctkCollapsibleGroupBoxEventTranslatorPlayerTest1 )
  281. SIMPLE_TEST( ctkColorDialogEventTranslatorPlayerTest1 )
  282. SIMPLE_TEST( ctkColorPickerButtonEventTranslatorPlayerTest1 )
  283. SIMPLE_TEST( ctkComboBoxEventTranslatorPlayerTest1 )
  284. SIMPLE_TEST( ctkConsoleEventTranslatorPlayerTest1 )
  285. SIMPLE_TEST( ctkCoordinatesWidgetEventTranslatorPlayerTest1 )
  286. # SIMPLE_TEST( ctkDateRangeWidgetEventTranslatorPlayerTest1 )
  287. SIMPLE_TEST( ctkDirectoryButtonEventTranslatorPlayerTest1 )
  288. SIMPLE_TEST( ctkDoubleRangeSliderEventTranslatorPlayerTest1 )
  289. SIMPLE_TEST( ctkDoubleSliderEventTranslatorPlayerTest1 )
  290. SIMPLE_TEST( ctkExpandButtonEventTranslatorPlayerTest1 )
  291. SIMPLE_TEST( ctkFileDialogEventTranslatorPlayerTest1 )
  292. SIMPLE_TEST( ctkFontButtonEventTranslatorPlayerTest1 )
  293. SIMPLE_TEST( ctkMaterialPropertyWidgetEventTranslatorPlayerTest1 )
  294. SIMPLE_TEST( ctkMatrixWidgetEventTranslatorPlayerTest1 )
  295. # SIMPLE_TEST( ctkMenuButtonEventTranslatorPlayerTest1 )
  296. SIMPLE_TEST( ctkMenuComboBoxEventTranslatorPlayerTest1 )
  297. SIMPLE_TEST( ctkMenuEventTranslatorPlayerTest1 )
  298. SIMPLE_TEST( ctkModalityWidgetEventTranslatorPlayerTest1 )
  299. SIMPLE_TEST( ctkPathLineEditEventTranslatorPlayerTest1 )
  300. SIMPLE_TEST( ctkPopupWidgetEventTranslatorPlayerTest1 )
  301. SIMPLE_TEST( ctkRangeSliderEventTranslatorPlayerTest1 )
  302. SIMPLE_TEST( ctkRangeWidgetEventTranslatorPlayerTest1 )
  303. # SIMPLE_TEST( ctkScreenshotDialogEventTranslatorPlayerTest1 )
  304. SIMPLE_TEST( ctkSearchBoxEventTranslatorPlayerTest1 )
  305. SIMPLE_TEST( ctkSettingsDialogEventTranslatorPlayerTest1 )
  306. SIMPLE_TEST( ctkSliderWidgetEventTranslatorPlayerTest1 )
  307. SIMPLE_TEST( ctkTreeComboBoxEventTranslatorPlayerTest1 )
  308. # SIMPLE_TEST( ctkWorkflowAbstractPagedWidgetEventTranslatorPlayerTest1 )
  309. # SIMPLE_TEST( ctkWorkflowButtonBoxWidgetEventTranslatorPlayerTest1 )
  310. # SIMPLE_TEST( ctkWorkflowGroupBoxEventTranslatorPlayerTest1 )
  311. # SIMPLE_TEST( ctkWorkflowStackedWidgetEventTranslatorPlayerTest1 )
  312. # SIMPLE_TEST( ctkWorkflowTabWidgetEventTranslatorPlayerTest1 )
  313. # SIMPLE_TEST( ctkWorkflowWidgetEventTranslatorPlayerTest1 )
  314. # SIMPLE_TEST( ctkWorkflowWidgetStepEventTranslatorPlayerTest1 )
  315. set_tests_properties(
  316. ctkMenuComboBoxEventTranslatorPlayerTest1
  317. ctkPathLineEditEventTranslatorPlayerTest1
  318. PROPERTIES RUN_SERIAL TRUE
  319. )
  320. endif()