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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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-file-io-openvibe-test)
  22. # ------------
  23. # Test naming
  24. # ------------
  25. # As IO test was part of original OpenViBE, prefix is set to vo (validation/open)
  26. SET(TEST_PREFIX vo)
  27. SET(TEST_MODULE FileIO-OV)
  28. # -------------------------
  29. # List of scenario to test
  30. # -------------------------
  31. # Test scenario for openvibe file format: reading and writing feature
  32. SET(TEST_SCENARIOS
  33. read-write
  34. )
  35. # ----------------------
  36. # Configure test target
  37. # ----------------------
  38. # This is just a way to have the test scripts available in the IDE
  39. FILE(GLOB_RECURSE script_files ${CMAKE_CURRENT_SOURCE_DIR}/*.mxs ${CMAKE_CURRENT_SOURCE_DIR}/*.xml.in)
  40. ADD_CUSTOM_TARGET(${PROJECT_NAME} SOURCES ${script_files})
  41. SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER ${VALIDATION_FOLDER})
  42. # ---------------------------
  43. # Add test to test to be run
  44. # ---------------------------
  45. FOREACH(SCENARIO ${TEST_SCENARIOS})
  46. # Modify test name to comply to naming rules
  47. SET(TEST_NAME ${TEST_PREFIX}${TEST_MODULE}-${SCENARIO})
  48. #Create scenario file with repository according to the test environement
  49. CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${SCENARIO}.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/${SCENARIO}.xml" @ONLY)
  50. SET(SCENARIO_TO_TEST "${CMAKE_CURRENT_BINARY_DIR}/${SCENARIO}.xml")
  51. ADD_TEST(NAME ${TEST_NAME}
  52. COMMAND ${CMAKE_COMMAND}
  53. -DUNQUOTE=1
  54. -DCMD1="${CMAKE_COMMAND} -E remove -f ${OVT_OPENVIBE_PLAYER_LOG_FILE}"
  55. # Launch the scenario with all boxes to test
  56. -DCMD2="${OVT_OPENVIBE_PLAYER} --mode=x --play-mode=ff --max-time=2000 --config-file=${OVT_OPENVIBE_DATA}/openvibe.conf --scenario-file=${SCENARIO_TO_TEST}"
  57. # Compare result with reference file
  58. -DCMD3="${CMAKE_COMMAND} -E compare_files ${OVT_TEST_DATA_DIR}/bci-motor-imagery.ov ${OVT_TEST_TEMPORARY_DIR}/output_ov.ov"
  59. -P ${OVT_CMAKE_DIR}/OvtRunMultipleCommand.cmake
  60. )
  61. SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OVT_OPENVIBE_PLAYER_LOG_FILE})
  62. ENDFOREACH()