You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #######################################################################
  2. # Software License Agreement (AGPL-3 License)
  3. #
  4. # OpenViBE SDK Test Software
  5. # Based on OpenViBE V1.1.0, Copyright (C) Inria, 2006-2015
  6. # Copyright (C) Inria, 2015-2017,V1.0
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU Affero General Public License version 3,
  10. # as published by the Free Software Foundation.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program.
  19. # If not, see <http://www.gnu.org/licenses/>.
  20. #######################################################################
  21. PROJECT(openvibe-module-socket-test)
  22. # ---------------------------------
  23. # Target macros
  24. # Defines target operating system, architecture and compiler
  25. # ---------------------------------
  26. SET_BUILD_PLATFORM()
  27. # ----------------------
  28. # Configure test target
  29. # ----------------------
  30. # Test that needs to called with parameters
  31. SET(TEST_WITH_PARAM
  32. uoSocketClientServerBaseTest.cpp
  33. uoSocketClientServerSyncCommunicationTest.cpp
  34. uoSocketClientServerASyncCommunicationTest.cpp
  35. )
  36. # Test that needs to called without parameters
  37. SET(TEST_NO_PARAM
  38. )
  39. # Create test sources list
  40. # This macro auto-generate ${PROJECT_NAME}.cpp
  41. # in the build tree. ${PROJECT_NAME}.cpp is
  42. # the test driver called by ctest to run
  43. # the different tests added to this target.
  44. CREATE_TEST_SOURCELIST (Tests
  45. ${PROJECT_NAME}.cpp
  46. ${TEST_WITH_PARAM}
  47. ${TEST_NO_PARAM}
  48. )
  49. ADD_EXECUTABLE(${PROJECT_NAME} ${Tests})
  50. INCLUDE("FindOpenViBE")
  51. INCLUDE("FindOpenViBECommon")
  52. INCLUDE("FindOpenViBEModuleSocket")
  53. SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER ${TESTS_FOLDER})
  54. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${OVT_UNIT_TOOLKIT_LIB} ${OV_MODULE_SOCKET})
  55. # Add test without parameter to driver
  56. FOREACH(test ${TEST_NO_PARAM})
  57. GET_FILENAME_COMPONENT(TName ${test} NAME_WE)
  58. ADD_TEST(NAME ${TName} COMMAND ${PROJECT_NAME} ${TName})
  59. ENDFOREACH()
  60. # Add test with parameter to driver
  61. SET(LOCALHOST "127.0.0.1")
  62. SET(TEST_PORT "1024")
  63. ADD_TEST(NAME uoSocketClientServerBaseTest COMMAND ${PROJECT_NAME} uoSocketClientServerBaseTest ${LOCALHOST} ${TEST_PORT})
  64. ADD_TEST(NAME uoSocketClientServerHostNameTest COMMAND ${PROJECT_NAME} uoSocketClientServerBaseTest "localhost" ${TEST_PORT})
  65. ADD_TEST(NAME uoSocketClientServerSyncCommunicationTest COMMAND ${PROJECT_NAME} uoSocketClientServerSyncCommunicationTest ${LOCALHOST} ${TEST_PORT} "1000")
  66. ADD_TEST(NAME uoSocketClientServerASyncCommunicationTest COMMAND ${PROJECT_NAME} uoSocketClientServerASyncCommunicationTest ${LOCALHOST} ${TEST_PORT} "1000")