CMakeLists.txt 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. set(KIT ${PROJECT_NAME})
  2. #
  3. # Tests
  4. #
  5. set(TEST_SOURCES
  6. ctkVTKDataSetArrayComboBoxTest1.cpp
  7. ctkVTKDataSetModelTest1.cpp
  8. ctkVTKMatrixWidgetTest1.cpp
  9. ctkVTKMagnifyViewTest1.cpp
  10. ctkVTKScalarBarWidgetTest1.cpp
  11. ctkVTKThresholdWidgetTest1.cpp
  12. ctkTransferFunctionBarsItemTest1.cpp
  13. ctkTransferFunctionViewTest1.cpp
  14. ctkTransferFunctionViewTest2.cpp
  15. ctkTransferFunctionViewTest3.cpp
  16. ctkTransferFunctionViewTest4.cpp
  17. ctkTransferFunctionViewTest5.cpp
  18. ctkVTKRenderViewTest1.cpp
  19. ctkVTKScalarsToColorsUtilsTest1.cpp
  20. ctkVTKSliceViewTest1.cpp
  21. ctkVTKSurfaceMaterialPropertyWidgetTest1.cpp
  22. ctkVTKTextPropertyWidgetTest1.cpp
  23. ctkVTKThumbnailViewTest1.cpp
  24. ctkVTKWidgetsUtilsTestGrabWidget.cpp
  25. )
  26. if(CTK_USE_CHARTS)
  27. set(TEST_SOURCES
  28. ctkVTKChartViewTest1.cpp
  29. ctkVTKVolumePropertyWidgetTest1.cpp
  30. ctkVTKScalarsToColorsViewTest1.cpp
  31. ctkVTKScalarsToColorsViewTest2.cpp
  32. ctkVTKScalarsToColorsViewTest3.cpp
  33. ctkVTKScalarsToColorsViewTest4.cpp
  34. ctkVTKScalarsToColorsWidgetTest1.cpp
  35. ctkVTKScalarsToColorsWidgetTest2.cpp
  36. ctkVTKScalarsToColorsWidgetTest3.cpp
  37. ${TEST_SOURCES})
  38. endif()
  39. #
  40. # Tests expecting CTKData to be set
  41. #
  42. if(EXISTS "${CTKData_DIR}")
  43. list(APPEND TEST_SOURCES
  44. ctkVTKMagnifyViewTest2.cpp
  45. ctkVTKSliceViewTest2.cpp
  46. ctkVTKRenderViewTest2.cpp
  47. )
  48. endif()
  49. #
  50. # Test expecting CTK_USE_QTTESTING to be ON
  51. #
  52. if(CTK_USE_QTTESTING)
  53. list(APPEND TEST_SOURCES
  54. ctkVTKDataSetArrayComboBoxEventTranslatorPlayerTest1.cpp
  55. ctkVTKDataSetModelEventTranslatorPlayerTest1.cpp
  56. # ctkVTKMagnifyViewEventTranslatorPlayerTest1.cpp
  57. ctkVTKMatrixWidgetEventTranslatorPlayerTest1.cpp
  58. ctkVTKRenderViewEventTranslatorPlayerTest1.cpp
  59. ctkVTKScalarBarWidgetEventTranslatorPlayerTest1.cpp
  60. # ctkVTKScalarsToColorsUtilsEventTranslatorPlayerTest1.cpp
  61. # ctkVTKScalarsToColorsViewEventTranslatorPlayerTest1.cpp
  62. # ctkVTKScalarsToColorsWidgetEventTranslatorPlayerTest1.cpp
  63. # ctkVTKSliceViewEventTranslatorPlayerTest1.cpp
  64. # ctkVTKSurfaceMaterialPropertyWidgetEventTranslatorPlayerTest1.cpp
  65. ctkVTKTextPropertyWidgetEventTranslatorPlayerTest1.cpp
  66. # ctkVTKThresholdWidgetEventTranslatorPlayerTest1.cpp
  67. # ctkVTKVolumePropertyWidgetEventTranslatorPlayerTest1.cpp
  68. )
  69. endif()
  70. create_test_sourcelist(Tests ${KIT}CppTests.cpp
  71. ${TEST_SOURCES}
  72. #EXTRA_INCLUDE TestingMacros.h
  73. )
  74. SET (TestsToRun ${Tests})
  75. REMOVE (TestsToRun ${KIT}CppTests.cpp)
  76. set(LIBRARY_NAME ${PROJECT_NAME})
  77. #
  78. # If CTK_USE_QTTESTING is ON
  79. #
  80. if(CTK_USE_QTTESTING)
  81. ctkQtTesting(Tests TEST_MOC_SOURCES TEST_UI_FORMS)
  82. endif()
  83. set(TEST_MOC_CPP)
  84. if(TEST_MOC_SOURCES)
  85. QT4_WRAP_CPP(TEST_MOC_CPP ${TEST_MOC_SOURCES})
  86. endif()
  87. set(TEST_UI_CPP)
  88. if(TEST_UI_FORMS)
  89. QT4_WRAP_UI(TEST_UI_CPP ${TEST_UI_FORMS})
  90. endif()
  91. add_executable(${KIT}CppTests ${Tests} ${TEST_MOC_CPP} ${TEST_UI_CPP})
  92. target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} vtkCharts ${CTK_BASE_LIBRARIES})
  93. #
  94. # Add Tests
  95. #
  96. SIMPLE_TEST( ctkVTKDataSetArrayComboBoxTest1 )
  97. SIMPLE_TEST( ctkVTKDataSetModelTest1 )
  98. SIMPLE_TEST( ctkVTKMagnifyViewTest1 )
  99. SIMPLE_TEST( ctkVTKMatrixWidgetTest1 )
  100. SIMPLE_TEST( ctkVTKScalarBarWidgetTest1 )
  101. SIMPLE_TEST( ctkVTKScalarsToColorsUtilsTest1 )
  102. SIMPLE_TEST( ctkVTKThresholdWidgetTest1 )
  103. SIMPLE_TEST( ctkTransferFunctionBarsItemTest1 )
  104. SIMPLE_TEST( ctkTransferFunctionViewTest1 )
  105. SIMPLE_TEST( ctkTransferFunctionViewTest2 )
  106. SIMPLE_TEST( ctkTransferFunctionViewTest3 )
  107. SIMPLE_TEST( ctkTransferFunctionViewTest4 )
  108. SIMPLE_TEST( ctkTransferFunctionViewTest5 )
  109. if(CTK_USE_CHARTS)
  110. SIMPLE_TEST( ctkVTKChartViewTest1 )
  111. SIMPLE_TEST( ctkVTKVolumePropertyWidgetTest1 )
  112. SIMPLE_TEST( ctkVTKScalarsToColorsViewTest1 )
  113. SIMPLE_TEST( ctkVTKScalarsToColorsViewTest2 )
  114. SIMPLE_TEST( ctkVTKScalarsToColorsViewTest3 )
  115. SIMPLE_TEST( ctkVTKScalarsToColorsViewTest4 )
  116. SIMPLE_TEST( ctkVTKScalarsToColorsWidgetTest1 )
  117. SIMPLE_TEST( ctkVTKScalarsToColorsWidgetTest2 )
  118. SIMPLE_TEST( ctkVTKScalarsToColorsWidgetTest3 )
  119. endif()
  120. SIMPLE_TEST( ctkVTKRenderViewTest1 )
  121. SIMPLE_TEST( ctkVTKSliceViewTest1 )
  122. SIMPLE_TEST( ctkVTKSurfaceMaterialPropertyWidgetTest1 )
  123. SIMPLE_TEST( ctkVTKTextPropertyWidgetTest1 )
  124. SIMPLE_TEST( ctkVTKThumbnailViewTest1 )
  125. SIMPLE_TEST( ctkVTKWidgetsUtilsTestGrabWidget )
  126. #
  127. # Add Tests expecting CTKData to be set
  128. #
  129. if(EXISTS "${CTKData_DIR}")
  130. set(baseline_relative_location Libs/Visualization/VTK/Widgets)
  131. macro(MAGNIFY_WIDGET_TEST TESTNAME TESTTYPE SIZE MAGNIFICATION)
  132. SIMPLE_TEST_WITH_DATA(${TESTNAME}${TESTTYPE} ${baseline_relative_location}
  133. -T "${TESTTYPE}"
  134. -S "${SIZE}"
  135. -M "${MAGNIFICATION}"
  136. )
  137. endmacro()
  138. #
  139. # Dependencies required so that these tests won't run in parallel
  140. #
  141. MAGNIFY_WIDGET_TEST( ctkVTKMagnifyViewTest2 OddOdd 341 17 )
  142. MAGNIFY_WIDGET_TEST( ctkVTKMagnifyViewTest2 EvenEven 340 18 )
  143. set_tests_properties( ctkVTKMagnifyViewTest2EvenEven
  144. PROPERTIES DEPENDS
  145. ctkVTKMagnifyViewTest2OddOdd )
  146. MAGNIFY_WIDGET_TEST( ctkVTKMagnifyViewTest2 OddEven 341 18 )
  147. set_tests_properties( ctkVTKMagnifyViewTest2OddEven
  148. PROPERTIES DEPENDS
  149. ctkVTKMagnifyViewTest2EvenEven )
  150. MAGNIFY_WIDGET_TEST( ctkVTKMagnifyViewTest2 EvenOdd 340 17 )
  151. set_tests_properties( ctkVTKMagnifyViewTest2EvenOdd
  152. PROPERTIES DEPENDS
  153. ctkVTKMagnifyViewTest2OddEven )
  154. SIMPLE_TEST_WITH_DATA( ctkVTKRenderViewTest2 ${baseline_relative_location})
  155. SIMPLE_TEST_WITH_DATA( ctkVTKSliceViewTest2 ${baseline_relative_location})
  156. endif()
  157. #
  158. # Add Tests expecting CTK_USE_QTTESTING to be set
  159. #
  160. if(CTK_USE_QTTESTING)
  161. SIMPLE_TEST( ctkVTKDataSetArrayComboBoxEventTranslatorPlayerTest1 )
  162. SIMPLE_TEST( ctkVTKDataSetModelEventTranslatorPlayerTest1 )
  163. # SIMPLE_TEST( ctkVTKMagnifyViewEventTranslatorPlayerTest1 )
  164. SIMPLE_TEST( ctkVTKMatrixWidgetEventTranslatorPlayerTest1 )
  165. SIMPLE_TEST( ctkVTKRenderViewEventTranslatorPlayerTest1 )
  166. SIMPLE_TEST( ctkVTKScalarBarWidgetEventTranslatorPlayerTest1 )
  167. # SIMPLE_TEST( ctkVTKScalarsToColorsUtilsEventTranslatorPlayerTest1 )
  168. # SIMPLE_TEST( ctkVTKScalarsToColorsViewEventTranslatorPlayerTest1 )
  169. # SIMPLE_TEST( ctkVTKScalarsToColorsWidgetEventTranslatorPlayerTest1 )
  170. # SIMPLE_TEST( ctkVTKSliceViewEventTranslatorPlayerTest1 )
  171. # SIMPLE_TEST( ctkVTKSurfaceMaterialPropertyWidgetEventTranslatorPlayerTest1 )
  172. SIMPLE_TEST( ctkVTKTextPropertyWidgetEventTranslatorPlayerTest1 )
  173. # SIMPLE_TEST( ctkVTKThresholdWidgetEventTranslatorPlayerTest1 )
  174. # SIMPLE_TEST( ctkVTKVolumePropertyWidgetEventTranslatorPlayerTest1 )
  175. endif()