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 3.5KB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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-classification-lda)
  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 Classification-LDA)
  28. # -------------------------
  29. # List of scenario to test
  30. # -------------------------
  31. # Test scenario for Classification-LDA
  32. SET(TEST_SCENARIOS
  33. Native
  34. Onevsall
  35. #Onevsone-HT
  36. Onevsone-PKPD
  37. #Onevsone-Voting
  38. )
  39. # Templates xml.in files
  40. SET (LDA_TEST LDA)
  41. # ----------------------
  42. # Configure test target
  43. # ----------------------
  44. # This is just a way to have the test scripts available in the IDE
  45. FILE(GLOB_RECURSE script_files ${CMAKE_CURRENT_SOURCE_DIR}/*.mxs ${CMAKE_CURRENT_SOURCE_DIR}/*.xml ${CMAKE_CURRENT_SOURCE_DIR}/*.xml.in)
  46. ADD_CUSTOM_TARGET(${PROJECT_NAME} SOURCES ${script_files})
  47. SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER ${VALIDATION_FOLDER})
  48. # ---------------------------
  49. # Add test to test to be run
  50. # ---------------------------
  51. FOREACH(SCENARIO ${TEST_SCENARIOS})
  52. # Create test name complying to naming rules
  53. SET(TEST_NAME ${TEST_PREFIX}${TEST_MODULE}-${SCENARIO})
  54. # create scenario file
  55. CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${LDA_TEST}-${SCENARIO}.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/${LDA_TEST}-${SCENARIO}.xml" @ONLY)
  56. CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${LDA_TEST}-Classification.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/${LDA_TEST}-Classification-${SCENARIO}.xml" @ONLY)
  57. # The test will compare files. It should be the same
  58. ADD_TEST(NAME ${TEST_NAME}
  59. COMMAND ${CMAKE_COMMAND}
  60. -DUNQUOTE=1
  61. -DCMD1="${CMAKE_COMMAND} -E remove -f ${OVT_OPENVIBE_PLAYER_LOG_FILE}"
  62. # Launch the training scenario
  63. -DCMD2="${OVT_OPENVIBE_PLAYER} --mode=x --max-time=2000 --play-mode=ff --config-file=${OVT_OPENVIBE_DATA}/openvibe.conf --scenario-file=${LDA_TEST}-${SCENARIO}.xml"
  64. # Launch python checking module
  65. -DCMD3="${Python3_EXECUTABLE} ${OVT_VALIDATION_TOOLKIT_PATH}/accuracy.py ${OVT_OPENVIBE_PLAYER_LOG_FILE} Cross-validation 55"
  66. # Launch Classification scenario
  67. -DCMD4="${OVT_OPENVIBE_PLAYER} --mode=x --max-time=2000 --play-mode=ff --config-file=${OVT_OPENVIBE_DATA}/openvibe.conf --scenario-file=${LDA_TEST}-Classification-${SCENARIO}.xml"
  68. # Launch python checking classification result
  69. -DCMD5="${Python3_EXECUTABLE} ${OVT_VALIDATION_TOOLKIT_PATH}/classification.py ${OVT_TEST_TEMPORARY_DIR}/before-classification-${SCENARIO}.csv ${OVT_TEST_TEMPORARY_DIR}/after-classification-${SCENARIO}.csv ${OVT_TEST_DATA_DIR}/classificationreference-${SCENARIO}.txt"
  70. -P ${OVT_CMAKE_DIR}/OvtRunMultipleCommand.cmake
  71. )
  72. SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OVT_OPENVIBE_PLAYER_LOG_FILE})
  73. ENDFOREACH()