CMakeLists.txt 3.8 KB

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