CMakeLists.txt 4.7 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. )
  11. GET_TARGET_PROPERTY(ctkDummyPluginPATH "CTKDummyPlugin" LOCATION)
  12. REMOVE_DEFINITIONS(-DCTKDummyPlugin)
  13. SET(KIT ${PROJECT_NAME})
  14. #
  15. # Test sources
  16. #
  17. SET(KITTests_SRCS
  18. ctkAbstractFactoryTest1.cpp
  19. ctkAbstractLibraryFactoryTest1.cpp
  20. ctkAbstractObjectFactoryTest1.cpp
  21. ctkAbstractPluginFactoryTest1.cpp
  22. ctkAbstractQObjectFactoryTest1.cpp
  23. ctkCallbackTest1.cpp
  24. ctkCheckableModelHelperTest1.cpp
  25. ctkCommandLineParserTest1.cpp
  26. ctkErrorLogModelTest1.cpp
  27. ctkErrorLogModelEntryGroupingTest1.cpp
  28. ctkErrorLogModelTerminalOutputTest1.cpp
  29. ctkErrorLogModelTest4.cpp
  30. ctkErrorLogFDMessageHandlerWithThreadsTest1.cpp
  31. ctkErrorLogQtMessageHandlerWithThreadsTest1.cpp
  32. ctkErrorLogStreamMessageHandlerWithThreadsTest1.cpp
  33. ctkHistogramTest1.cpp
  34. ctkLoggerTest1.cpp
  35. ctkModelTesterTest1.cpp
  36. ctkModelTesterTest2.cpp
  37. ctkUtilsClosestPowerOfTenTest1.cpp
  38. ctkUtilsOrderOfMagnitudeTest1.cpp
  39. ctkUtilsQtHandleToStringTest1.cpp
  40. ctkUtilsSignificantDecimalsTest1.cpp
  41. ctkUtilsTest1.cpp
  42. ctkUtilsTest2.cpp
  43. ctkUtilsTest3.cpp
  44. ctkUtilsTest4.cpp
  45. ctkDependencyGraphTest1.cpp
  46. ctkDependencyGraphTest2.cpp
  47. ctkPimplTest1.cpp
  48. ctkScopedCurrentDirTest1.cpp
  49. ctkSingletonTest1.cpp
  50. ctkTransferFunctionTest1.cpp
  51. ctkTransferFunctionRepresentationTest1.cpp
  52. ctkTransferFunctionRepresentationTest2.cpp
  53. ctkWorkflowTest1.cpp
  54. ctkWorkflowTest2.cpp
  55. ctkWorkflowTest3.cpp
  56. )
  57. IF(HAVE_BFD)
  58. LIST(APPEND KITTests_SRCS
  59. ctkBinaryFileDescriptorTest1.cpp
  60. )
  61. ENDIF()
  62. CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
  63. ${KITTests_SRCS}
  64. #EXTRA_INCLUDE TestingMacros.h
  65. )
  66. SET (TestsToRun ${Tests})
  67. REMOVE (TestsToRun ${KIT}CppTests.cpp)
  68. SET(LIBRARY_NAME ${PROJECT_NAME})
  69. #
  70. # Tests Helpers sources
  71. #
  72. SET(Tests_Helpers_SRCS
  73. ctkBranchingWorkflowStep.h
  74. ctkExampleDerivedWorkflowStep.cpp
  75. ctkExampleDerivedWorkflowStep.h
  76. ctkExampleWorkflowStepUsingSignalsAndSlots.cpp
  77. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  78. ctkSingletonTestHelper.cpp
  79. ctkSingletonTestHelper.h
  80. )
  81. SET(Tests_Helpers_MOC_SRCS
  82. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  83. )
  84. SET(Tests_Helpers_MOC_CPP)
  85. QT4_WRAP_CPP(Tests_Helpers_MOC_CPP ${Tests_Helpers_MOC_SRCS})
  86. IF(HAVE_BFD)
  87. ADD_EXECUTABLE(ctkBinaryFileDescriptorTestHelper ctkBinaryFileDescriptorTestHelper.cpp)
  88. ENDIF()
  89. IF(WIN32)
  90. ADD_DEFINITIONS( /D _CRT_SECURE_NO_WARNINGS)
  91. ENDIF()
  92. #
  93. # Test executable
  94. #
  95. ADD_EXECUTABLE(${KIT}CppTests ${Tests} ${Tests_Helpers_SRCS} ${Tests_Helpers_MOC_CPP})
  96. TARGET_LINK_LIBRARIES(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES} CTKDummyPlugin)
  97. MACRO( SIMPLE_TEST TESTNAME )
  98. ADD_TEST(NAME ${TESTNAME} COMMAND $<TARGET_FILE:${KIT}CppTests> ${TESTNAME} ${ARGN})
  99. SET_PROPERTY(TEST ${TESTNAME} PROPERTY LABELS ${PROJECT_NAME})
  100. ENDMACRO( SIMPLE_TEST )
  101. #
  102. # Add Tests
  103. #
  104. SIMPLE_TEST( ctkAbstractFactoryTest1 )
  105. SIMPLE_TEST( ctkAbstractLibraryFactoryTest1 ${ctkDummyPluginPATH} )
  106. SIMPLE_TEST( ctkAbstractObjectFactoryTest1 )
  107. SIMPLE_TEST( ctkAbstractPluginFactoryTest1 ${ctkDummyPluginPATH} )
  108. SIMPLE_TEST( ctkAbstractQObjectFactoryTest1 )
  109. IF(HAVE_BFD)
  110. SIMPLE_TEST( ctkBinaryFileDescriptorTest1 $<TARGET_FILE:ctkBinaryFileDescriptorTestHelper> )
  111. ENDIF()
  112. SIMPLE_TEST( ctkCallbackTest1 )
  113. SIMPLE_TEST( ctkCheckableModelHelperTest1 )
  114. SIMPLE_TEST( ctkCommandLineParserTest1 )
  115. SIMPLE_TEST( ctkDependencyGraphTest1 )
  116. SIMPLE_TEST( ctkDependencyGraphTest2 )
  117. SIMPLE_TEST( ctkErrorLogModelTest1 )
  118. SIMPLE_TEST( ctkErrorLogModelEntryGroupingTest1 )
  119. SIMPLE_TEST( ctkErrorLogModelTerminalOutputTest1 --test-launcher $<TARGET_FILE:${KIT}CppTests>)
  120. SIMPLE_TEST( ctkErrorLogModelTest4 )
  121. SIMPLE_TEST( ctkErrorLogFDMessageHandlerWithThreadsTest1 )
  122. SIMPLE_TEST( ctkErrorLogQtMessageHandlerWithThreadsTest1 )
  123. SIMPLE_TEST( ctkErrorLogStreamMessageHandlerWithThreadsTest1 )
  124. SIMPLE_TEST( ctkHistogramTest1 )
  125. SIMPLE_TEST( ctkLoggerTest1 )
  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( ctkUtilsQtHandleToStringTest1 )
  137. SIMPLE_TEST( ctkUtilsSignificantDecimalsTest1 )
  138. SIMPLE_TEST( ctkUtilsTest1 )
  139. SIMPLE_TEST( ctkUtilsTest2 )
  140. SIMPLE_TEST( ctkUtilsTest3 )
  141. SIMPLE_TEST( ctkUtilsTest4 )
  142. SIMPLE_TEST( ctkWorkflowTest1 )
  143. SIMPLE_TEST( ctkWorkflowTest2 )
  144. SIMPLE_TEST( ctkWorkflowTest3 )