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.

DartTestfile.txt 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. IF(WIN32)
  2. SET(EXT cmd)
  3. SET(OS_FLAGS "--no-pause")
  4. ELSE()
  5. SET(EXT sh)
  6. SET(OS_FLAGS "")
  7. ENDIF()
  8. ############
  9. SET(TEST_NAME gdfreader)
  10. SET(SCENARIO_TO_TEST "${TEST_NAME}-test.xml")
  11. ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "output_gdf*.csv")
  12. ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" ${SCENARIO_TO_TEST})
  13. ADD_TEST(compare_${TEST_NAME}_125 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf125.csv" "test_gdfX.ref.csv" 0.0001)
  14. ADD_TEST(compare_${TEST_NAME}_211 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf211.csv" "test_gdfX.ref.csv" 0.0001)
  15. ADD_TEST(compare_${TEST_NAME}_221 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf221.csv" "test_gdfX.ref.csv" 0.0001)
  16. ADD_TEST(compare_${TEST_NAME}_222 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf222.csv" "test_gdfX.ref.csv" 0.0001)
  17. SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_CONFIG_SUBDIR})
  18. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_125 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf125.csv")
  19. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_211 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf211.csv")
  20. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_221 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf221.csv")
  21. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_222 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf222.csv")
  22. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_125 PROPERTIES DEPENDS run_${TEST_NAME})
  23. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_211 PROPERTIES DEPENDS run_${TEST_NAME})
  24. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_221 PROPERTIES DEPENDS run_${TEST_NAME})
  25. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_222 PROPERTIES DEPENDS run_${TEST_NAME})
  26. SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME})
  27. ##############
  28. SET(TEST_NAME ov-read-write)
  29. SET(SCENARIO_TO_TEST "${TEST_NAME}-test.xml")
  30. ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "output_ov.ov")
  31. ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" ${SCENARIO_TO_TEST})
  32. ADD_TEST(compare_${TEST_NAME} "git" "diff" "--no-index" "../signals/bci-motor-imagery.ov" "output_ov.ov")
  33. SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  34. SET_TESTS_PROPERTIES(compare_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  35. SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME})
  36. SET_TESTS_PROPERTIES(compare_${TEST_NAME} PROPERTIES DEPENDS run_${TEST_NAME})
  37. #############
  38. SET(TEST_NAME csv-read-write)
  39. SET(SCENARIO_TO_TEST "${TEST_NAME}-test.xml")
  40. ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "output_signal.csv" "output_streamedmatrix.csv" "output_stimulation.csv" "output_spectrum.csv" "output_features.csv")
  41. ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" ${SCENARIO_TO_TEST})
  42. ADD_TEST(compare_${TEST_NAME}_signal "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_signal.csv" "output_signal.csv" 0.0001)
  43. ADD_TEST(compare_${TEST_NAME}_matrix "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_streamedmatrix.csv" "output_streamedmatrix.csv" 0.0001)
  44. ADD_TEST(compare_${TEST_NAME}_stimulation "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_stimulation.csv" "output_stimulation.csv" 0.0001)
  45. ADD_TEST(compare_${TEST_NAME}_spectrum "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_spectrum.csv" "output_spectrum.csv" 0.0001)
  46. ADD_TEST(compare_${TEST_NAME}_features "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_features.csv" "output_features.csv" 0.0001)
  47. SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  48. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_signal PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  49. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_matrix PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  50. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_stimulation PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  51. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_spectrum PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  52. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_features PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  53. SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME})
  54. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_signal PROPERTIES DEPENDS run_${TEST_NAME})
  55. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_matrix PROPERTIES DEPENDS run_${TEST_NAME})
  56. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_stimulation PROPERTIES DEPENDS run_${TEST_NAME})
  57. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_spectrum PROPERTIES DEPENDS run_${TEST_NAME})
  58. SET_TESTS_PROPERTIES(compare_${TEST_NAME}_features PROPERTIES DEPENDS run_${TEST_NAME})
  59. ###################
  60. #
  61. # This test basically first writes test data to CSV "1", then CSV "1" to GDF (test 'GDF Writer'), then GDF to CSV "2" (test 'GDF Reader').
  62. # Finally, the CSV "1" and CSV "2" are compared for equality, both for signals and stimulations.
  63. #
  64. # We use CSV because of the float scaling in the GDF Writer and Reader, we don't seem to be able to maintain bitwise equality between read and write?
  65. #
  66. SET(TEST_NAME gdf-readwrite)
  67. ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "output*.csv" "output*.gdf")
  68. ADD_TEST(run_${TEST_NAME}-1 "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" "test-gdf-readwrite-1.xml")
  69. ADD_TEST(run_${TEST_NAME}-2 "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" "test-gdf-readwrite-2.xml")
  70. ADD_TEST(run_${TEST_NAME}-3 "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" "test-gdf-readwrite-3.xml")
  71. ADD_TEST(compare_${TEST_NAME}-signal "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf_signal_1.csv" "output_gdf_signal_2.csv" 0.001)
  72. SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
  73. SET_TESTS_PROPERTIES(compare_${TEST_NAME}-signal PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf_signal_1.csv" "output_gdf_signal_2.csv")
  74. SET_TESTS_PROPERTIES(run_${TEST_NAME}-1 PROPERTIES DEPENDS clean_${TEST_NAME})
  75. SET_TESTS_PROPERTIES(run_${TEST_NAME}-2 PROPERTIES DEPENDS run_${TEST_NAME}-1)
  76. SET_TESTS_PROPERTIES(run_${TEST_NAME}-3 PROPERTIES DEPENDS run_${TEST_NAME}-2)
  77. SET_TESTS_PROPERTIES(compare_${TEST_NAME}-signal PROPERTIES DEPENDS run_${TEST_NAME}-3)
  78. SET_TESTS_PROPERTIES(compare_${TEST_NAME}-stim PROPERTIES DEPENDS run_${TEST_NAME}-3)