CMakeLists.txt 4.9 KB

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