CMakeLists.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. ctkCommandLineParserTest1.cpp
  25. ctkErrorLogModelTest1.cpp
  26. ctkErrorLogModelTest2.cpp
  27. ctkModelTesterTest1.cpp
  28. ctkUtilsTest1.cpp
  29. ctkUtilsTest2.cpp
  30. ctkDependencyGraphTest1.cpp
  31. ctkDependencyGraphTest2.cpp
  32. ctkPimplTest1.cpp
  33. ctkSingletonTest1.cpp
  34. ctkWorkflowTest1.cpp
  35. ctkWorkflowTest2.cpp
  36. ctkWorkflowTest3.cpp
  37. )
  38. IF(HAVE_BFD)
  39. LIST(APPEND KITTests_SRCS
  40. ctkBinaryFileDescriptorTest1.cpp
  41. )
  42. ENDIF()
  43. CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
  44. ${KITTests_SRCS}
  45. #EXTRA_INCLUDE TestingMacros.h
  46. )
  47. SET (TestsToRun ${Tests})
  48. REMOVE (TestsToRun ${KIT}CppTests.cpp)
  49. SET(LIBRARY_NAME ${PROJECT_NAME})
  50. #
  51. # Tests Helpers sources
  52. #
  53. SET(Tests_Helpers_SRCS
  54. ctkBranchingWorkflowStep.h
  55. ctkExampleDerivedWorkflowStep.cpp
  56. ctkExampleDerivedWorkflowStep.h
  57. ctkExampleWorkflowStepUsingSignalsAndSlots.cpp
  58. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  59. ctkSingletonTestHelper.cpp
  60. ctkSingletonTestHelper.h
  61. )
  62. SET(Tests_Helpers_MOC_SRCS
  63. ctkExampleWorkflowStepUsingSignalsAndSlots.h
  64. )
  65. SET(Tests_Helpers_MOC_CPP)
  66. QT4_WRAP_CPP(Tests_Helpers_MOC_CPP ${Tests_Helpers_MOC_SRCS})
  67. IF(HAVE_BFD)
  68. ADD_EXECUTABLE(ctkBinaryFileDescriptorTestHelper ctkBinaryFileDescriptorTestHelper.cpp)
  69. ENDIF()
  70. #
  71. # Test executable
  72. #
  73. ADD_EXECUTABLE(${KIT}CppTests ${Tests} ${Tests_Helpers_SRCS} ${Tests_Helpers_MOC_CPP})
  74. TARGET_LINK_LIBRARIES(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES} CTKDummyPlugin)
  75. SET( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
  76. MACRO( SIMPLE_TEST TESTNAME )
  77. ADD_TEST( ${TESTNAME} ${KIT_TESTS} ${TESTNAME} )
  78. SET_PROPERTY(TEST ${TESTNAME} PROPERTY LABELS ${PROJECT_NAME})
  79. ENDMACRO( SIMPLE_TEST )
  80. #
  81. # Add Tests
  82. #
  83. SIMPLE_TEST( ctkAbstractFactoryTest1 )
  84. SIMPLE_TEST( ctkAbstractLibraryFactoryTest1 )
  85. SIMPLE_TEST( ctkAbstractObjectFactoryTest1 )
  86. ADD_TEST( ctkAbstractPluginFactoryTest1 ${KIT_TESTS} ctkAbstractPluginFactoryTest1 ${ctkDummyPluginPATH})
  87. SET_PROPERTY(TEST ctkAbstractPluginFactoryTest1 PROPERTY LABELS ${PROJECT_NAME})
  88. SIMPLE_TEST( ctkAbstractQObjectFactoryTest1 )
  89. IF(HAVE_BFD)
  90. ADD_TEST(NAME ctkBinaryFileDescriptorTest1 COMMAND ${KIT_TESTS} ctkBinaryFileDescriptorTest1 $<TARGET_FILE:ctkBinaryFileDescriptorTestHelper>)
  91. SET_PROPERTY(TEST ctkBinaryFileDescriptorTest1 PROPERTY LABELS ${PROJECT_NAME})
  92. ENDIF()
  93. SIMPLE_TEST( ctkCommandLineParserTest1 )
  94. SIMPLE_TEST( ctkDependencyGraphTest1 )
  95. SIMPLE_TEST( ctkDependencyGraphTest2 )
  96. SIMPLE_TEST( ctkErrorLogModelTest1 )
  97. SIMPLE_TEST( ctkErrorLogModelTest2 )
  98. SIMPLE_TEST( ctkModelTesterTest1 )
  99. SIMPLE_TEST( ctkPimplTest1 )
  100. SIMPLE_TEST( ctkSingletonTest1 )
  101. SIMPLE_TEST( ctkUtilsTest1 )
  102. SIMPLE_TEST( ctkUtilsTest2 )
  103. SIMPLE_TEST( ctkWorkflowTest1 )
  104. SIMPLE_TEST( ctkWorkflowTest2 )
  105. SIMPLE_TEST( ctkWorkflowTest3 )