CMakeLists.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # Dummy plugin used by ctkAbstractPluginFactoryTest1
  2. ADD_DEFINITIONS( -DCTKDummyPlugin)
  3. ctkMacroBuildLib(
  4. NAME "CTKDummyPlugin"
  5. EXPORT_DIRECTIVE "CTK_DUMMY_EXPORT"
  6. SRCS ctkDummyPlugin.h ctkDummyPlugin.cpp
  7. MOC_SRCS "ctkDummyPlugin.h"
  8. TARGET_LIBRARIES ${CTK_BASE_LIBRARIES}
  9. LIBRARY_TYPE "SHARED"
  10. DISABLE_WRAP_PYTHONQT
  11. )
  12. GET_TARGET_PROPERTY(ctkDummyPluginPATH "CTKDummyPlugin" LOCATION)
  13. REMOVE_DEFINITIONS(-DCTKDummyPlugin)
  14. SET(KIT ${PROJECT_NAME})
  15. #
  16. # Test sources
  17. #
  18. SET(KITTests_SRCS
  19. ctkAbstractFactoryTest1.cpp
  20. ctkAbstractLibraryFactoryTest1.cpp
  21. ctkAbstractObjectFactoryTest1.cpp
  22. ctkAbstractPluginFactoryTest1.cpp
  23. ctkAbstractQObjectFactoryTest1.cpp
  24. ctkCallbackTest1.cpp
  25. ctkCheckableModelHelperTest1.cpp
  26. ctkCommandLineParserTest1.cpp
  27. ctkErrorLogModelTest1.cpp
  28. ctkErrorLogModelTest2.cpp
  29. ctkErrorLogModelTest3.cpp
  30. ctkErrorLogModelTest4.cpp
  31. ctkHistogramTest1.cpp
  32. ctkLoggerTest1.cpp
  33. ctkModelTesterTest1.cpp
  34. ctkModelTesterTest2.cpp
  35. ctkUtilsClosestPowerOfTenTest1.cpp
  36. ctkUtilsOrderOfMagnitudeTest1.cpp
  37. ctkUtilsSignificantDecimalsTest1.cpp
  38. ctkUtilsTest1.cpp
  39. ctkUtilsTest2.cpp
  40. ctkUtilsTest3.cpp
  41. ctkUtilsTest4.cpp
  42. ctkDependencyGraphTest1.cpp
  43. ctkDependencyGraphTest2.cpp
  44. ctkPimplTest1.cpp
  45. ctkScopedCurrentDirTest1.cpp
  46. ctkSingletonTest1.cpp
  47. ctkTransferFunctionTest1.cpp
  48. ctkTransferFunctionRepresentationTest1.cpp
  49. ctkTransferFunctionRepresentationTest2.cpp
  50. ctkWorkflowTest1.cpp
  51. ctkWorkflowTest2.cpp
  52. ctkWorkflowTest3.cpp
  53. )
  54. IF(HAVE_BFD)
  55. LIST(APPEND KITTests_SRCS
  56. ctkBinaryFileDescriptorTest1.cpp
  57. )
  58. ENDIF()
  59. CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
  60. ${KITTests_SRCS}
  61. #EXTRA_INCLUDE TestingMacros.h
  62. )
  63. SET (TestsToRun ${Tests})
  64. REMOVE (TestsToRun ${KIT}CppTests.cpp)
  65. SET(LIBRARY_NAME ${PROJECT_NAME})
  66. #
  67. # Tests Helpers sources
  68. #
  69. SET(Tests_Helpers_SRCS
  70. ctkBranchingWorkflowStep.h
  71. ctkExampleDerivedWorkflowStep.cpp
  72. ctkExampleDerivedWorkflowStep.h
  73. ctkExampleWorkflowStepUsingSignalsAndSlots.cpp
  74. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  75. ctkSingletonTestHelper.cpp
  76. ctkSingletonTestHelper.h
  77. )
  78. SET(Tests_Helpers_MOC_SRCS
  79. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  80. )
  81. SET(Tests_Helpers_MOC_CPP)
  82. QT4_WRAP_CPP(Tests_Helpers_MOC_CPP ${Tests_Helpers_MOC_SRCS})
  83. IF(HAVE_BFD)
  84. ADD_EXECUTABLE(ctkBinaryFileDescriptorTestHelper ctkBinaryFileDescriptorTestHelper.cpp)
  85. ENDIF()
  86. IF(WIN32)
  87. ADD_DEFINITIONS( /D _CRT_SECURE_NO_WARNINGS)
  88. ENDIF()
  89. #
  90. # Test executable
  91. #
  92. ADD_EXECUTABLE(${KIT}CppTests ${Tests} ${Tests_Helpers_SRCS} ${Tests_Helpers_MOC_CPP})
  93. TARGET_LINK_LIBRARIES(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES} CTKDummyPlugin)
  94. SET( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
  95. MACRO( SIMPLE_TEST TESTNAME )
  96. ADD_TEST( ${TESTNAME} ${KIT_TESTS} ${TESTNAME} )
  97. SET_PROPERTY(TEST ${TESTNAME} PROPERTY LABELS ${PROJECT_NAME})
  98. ENDMACRO( SIMPLE_TEST )
  99. #
  100. # Add Tests
  101. #
  102. SIMPLE_TEST( ctkAbstractFactoryTest1 )
  103. ADD_TEST( ctkAbstractLibraryFactoryTest1 ${KIT_TESTS} ctkAbstractLibraryFactoryTest1 ${ctkDummyPluginPATH})
  104. SET_PROPERTY(TEST ctkAbstractLibraryFactoryTest1 PROPERTY LABELS ${PROJECT_NAME})
  105. SIMPLE_TEST( ctkAbstractObjectFactoryTest1 )
  106. ADD_TEST( ctkAbstractPluginFactoryTest1 ${KIT_TESTS} ctkAbstractPluginFactoryTest1 ${ctkDummyPluginPATH})
  107. SET_PROPERTY(TEST ctkAbstractPluginFactoryTest1 PROPERTY LABELS ${PROJECT_NAME})
  108. SIMPLE_TEST( ctkAbstractQObjectFactoryTest1 )
  109. IF(HAVE_BFD)
  110. ADD_TEST(NAME ctkBinaryFileDescriptorTest1 COMMAND ${KIT_TESTS} ctkBinaryFileDescriptorTest1 $<TARGET_FILE:ctkBinaryFileDescriptorTestHelper>)
  111. SET_PROPERTY(TEST ctkBinaryFileDescriptorTest1 PROPERTY LABELS ${PROJECT_NAME})
  112. ENDIF()
  113. SIMPLE_TEST( ctkCallbackTest1 )
  114. SIMPLE_TEST( ctkCheckableModelHelperTest1 )
  115. SIMPLE_TEST( ctkCommandLineParserTest1 )
  116. SIMPLE_TEST( ctkDependencyGraphTest1 )
  117. SIMPLE_TEST( ctkDependencyGraphTest2 )
  118. SIMPLE_TEST( ctkErrorLogModelTest1 )
  119. SIMPLE_TEST( ctkErrorLogModelTest2 )
  120. SIMPLE_TEST( ctkErrorLogModelTest3 )
  121. SIMPLE_TEST( ctkErrorLogModelTest4 )
  122. SIMPLE_TEST( ctkHistogramTest1 )
  123. SIMPLE_TEST( ctkLoggerTest1 )
  124. SET_TESTS_PROPERTIES(ctkErrorLogModelTest3 PROPERTIES PASS_REGULAR_EXPRESSION
  125. "This is a qDebug message\nThis is a std::cerr message\nThis is a qWarning message\nThis is a std::cout message\nThis is a qCritical message\n")
  126. SIMPLE_TEST( ctkModelTesterTest1 )
  127. SIMPLE_TEST( ctkModelTesterTest2 )
  128. SIMPLE_TEST( ctkPimplTest1 )
  129. SIMPLE_TEST( ctkScopedCurrentDirTest1 )
  130. SIMPLE_TEST( ctkSingletonTest1 )
  131. SIMPLE_TEST( ctkTransferFunctionTest1 )
  132. SIMPLE_TEST( ctkTransferFunctionRepresentationTest1 )
  133. SIMPLE_TEST( ctkTransferFunctionRepresentationTest2 )
  134. SIMPLE_TEST( ctkUtilsClosestPowerOfTenTest1 )
  135. SIMPLE_TEST( ctkUtilsOrderOfMagnitudeTest1 )
  136. SIMPLE_TEST( ctkUtilsSignificantDecimalsTest1 )
  137. SIMPLE_TEST( ctkUtilsTest1 )
  138. SIMPLE_TEST( ctkUtilsTest2 )
  139. SIMPLE_TEST( ctkUtilsTest3 )
  140. SIMPLE_TEST( ctkUtilsTest4 )
  141. SIMPLE_TEST( ctkWorkflowTest1 )
  142. SIMPLE_TEST( ctkWorkflowTest2 )
  143. SIMPLE_TEST( ctkWorkflowTest3 )