CMakeLists.txt 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. ctkBooleanMapperTest.cpp
  24. ctkCallbackTest1.cpp
  25. ctkCheckableModelHelperTest1.cpp
  26. ctkCommandLineParserTest1.cpp
  27. ctkErrorLogModelTest1.cpp
  28. ctkErrorLogModelEntryGroupingTest1.cpp
  29. ctkErrorLogModelTerminalOutputTest1.cpp
  30. ctkErrorLogModelTest4.cpp
  31. ctkErrorLogFDMessageHandlerWithThreadsTest1.cpp
  32. ctkErrorLogQtMessageHandlerWithThreadsTest1.cpp
  33. ctkErrorLogStreamMessageHandlerWithThreadsTest1.cpp
  34. ctkHistogramTest1.cpp
  35. ctkLoggerTest1.cpp
  36. ctkModelTesterTest1.cpp
  37. ctkModelTesterTest2.cpp
  38. ctkUtilsClosestPowerOfTenTest1.cpp
  39. ctkUtilsOrderOfMagnitudeTest1.cpp
  40. ctkUtilsQtHandleToStringTest1.cpp
  41. ctkUtilsSignificantDecimalsTest1.cpp
  42. ctkUtilsTest1.cpp
  43. ctkUtilsTest2.cpp
  44. ctkUtilsTest3.cpp
  45. ctkUtilsTest4.cpp
  46. ctkDependencyGraphTest1.cpp
  47. ctkDependencyGraphTest2.cpp
  48. ctkPimplTest1.cpp
  49. ctkScopedCurrentDirTest1.cpp
  50. ctkSingletonTest1.cpp
  51. ctkTransferFunctionTest1.cpp
  52. ctkTransferFunctionRepresentationTest1.cpp
  53. ctkTransferFunctionRepresentationTest2.cpp
  54. ctkWorkflowTest1.cpp
  55. ctkWorkflowTest2.cpp
  56. ctkWorkflowTest3.cpp
  57. )
  58. if(HAVE_BFD)
  59. list(APPEND KITTests_SRCS
  60. ctkBinaryFileDescriptorTest1.cpp
  61. )
  62. endif()
  63. include_directories(
  64. ${CMAKE_SOURCE_DIR}/Libs/Testing
  65. ${CMAKE_CURRENT_BINARY_DIR}
  66. )
  67. create_test_sourcelist(Tests ${KIT}CppTests.cpp
  68. ${KITTests_SRCS}
  69. #EXTRA_INCLUDE TestingMacros.h
  70. )
  71. SET(TestsToRun ${Tests})
  72. REMOVE(TestsToRun ${KIT}CppTests.cpp)
  73. set(LIBRARY_NAME ${PROJECT_NAME})
  74. #
  75. # Tests Helpers sources
  76. #
  77. set(Tests_Helpers_SRCS
  78. ctkBranchingWorkflowStep.h
  79. ctkExampleDerivedWorkflowStep.cpp
  80. ctkExampleDerivedWorkflowStep.h
  81. ctkExampleWorkflowStepUsingSignalsAndSlots.cpp
  82. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  83. ctkSingletonTestHelper.cpp
  84. ctkSingletonTestHelper.h
  85. )
  86. set(Tests_Helpers_MOC_SRCS
  87. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  88. )
  89. set(Tests_Helpers_MOC_CPP)
  90. QT4_WRAP_CPP(Tests_Helpers_MOC_CPP ${Tests_Helpers_MOC_SRCS})
  91. QT4_GENERATE_MOCS(
  92. ctkBooleanMapperTest.cpp
  93. )
  94. if(HAVE_BFD)
  95. add_executable(ctkBinaryFileDescriptorTestHelper ctkBinaryFileDescriptorTestHelper.cpp)
  96. endif()
  97. if(WIN32)
  98. add_definitions( /D _CRT_SECURE_NO_WARNINGS)
  99. endif()
  100. #
  101. # Test executable
  102. #
  103. add_executable(${KIT}CppTests ${Tests} ${Tests_Helpers_SRCS} ${Tests_Helpers_MOC_CPP})
  104. target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES} CTKDummyPlugin)
  105. #
  106. # Add Tests
  107. #
  108. SIMPLE_TEST( ctkAbstractFactoryTest1 )
  109. SIMPLE_TEST( ctkAbstractLibraryFactoryTest1 ${ctkDummyPluginPATH} )
  110. SIMPLE_TEST( ctkAbstractObjectFactoryTest1 )
  111. SIMPLE_TEST( ctkAbstractPluginFactoryTest1 ${ctkDummyPluginPATH} )
  112. SIMPLE_TEST( ctkAbstractQObjectFactoryTest1 )
  113. if(HAVE_BFD)
  114. SIMPLE_TEST( ctkBinaryFileDescriptorTest1 $<TARGET_FILE:ctkBinaryFileDescriptorTestHelper> )
  115. endif()
  116. SIMPLE_TEST( ctkBooleanMapperTest )
  117. SIMPLE_TEST( ctkCallbackTest1 )
  118. SIMPLE_TEST( ctkCheckableModelHelperTest1 )
  119. SIMPLE_TEST( ctkCommandLineParserTest1 )
  120. SIMPLE_TEST( ctkDependencyGraphTest1 )
  121. SIMPLE_TEST( ctkDependencyGraphTest2 )
  122. SIMPLE_TEST( ctkErrorLogModelTest1 )
  123. SIMPLE_TEST( ctkErrorLogModelEntryGroupingTest1 )
  124. SIMPLE_TEST( ctkErrorLogModelTerminalOutputTest1 --test-launcher $<TARGET_FILE:${KIT}CppTests>)
  125. SIMPLE_TEST( ctkErrorLogModelTest4 )
  126. SIMPLE_TEST( ctkErrorLogFDMessageHandlerWithThreadsTest1 )
  127. SIMPLE_TEST( ctkErrorLogQtMessageHandlerWithThreadsTest1 )
  128. SIMPLE_TEST( ctkErrorLogStreamMessageHandlerWithThreadsTest1 )
  129. SIMPLE_TEST( ctkHistogramTest1 )
  130. SIMPLE_TEST( ctkLoggerTest1 )
  131. set_property(TEST ctkLoggerTest1 PROPERTY PASS_REGULAR_EXPRESSION "logger.debug\nlogger.info\nlogger.trace\nlogger.warn\nlogger.error\nlogger.fatal")
  132. SIMPLE_TEST( ctkModelTesterTest1 )
  133. SIMPLE_TEST( ctkModelTesterTest2 )
  134. SIMPLE_TEST( ctkPimplTest1 )
  135. SIMPLE_TEST( ctkScopedCurrentDirTest1 )
  136. SIMPLE_TEST( ctkSingletonTest1 )
  137. SIMPLE_TEST( ctkTransferFunctionTest1 )
  138. SIMPLE_TEST( ctkTransferFunctionRepresentationTest1 )
  139. SIMPLE_TEST( ctkTransferFunctionRepresentationTest2 )
  140. SIMPLE_TEST( ctkUtilsClosestPowerOfTenTest1 )
  141. SIMPLE_TEST( ctkUtilsOrderOfMagnitudeTest1 )
  142. SIMPLE_TEST( ctkUtilsQtHandleToStringTest1 )
  143. SIMPLE_TEST( ctkUtilsSignificantDecimalsTest1 )
  144. SIMPLE_TEST( ctkUtilsTest1 )
  145. SIMPLE_TEST( ctkUtilsTest2 )
  146. SIMPLE_TEST( ctkUtilsTest3 )
  147. SIMPLE_TEST( ctkUtilsTest4 )
  148. SIMPLE_TEST( ctkWorkflowTest1 )
  149. SIMPLE_TEST( ctkWorkflowTest2 )
  150. SIMPLE_TEST( ctkWorkflowTest3 )