123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
-
- IF(WIN32)
- SET(EXT cmd)
- SET(OS_FLAGS "--no-pause")
- ELSE()
- SET(EXT sh)
- SET(OS_FLAGS "")
- ENDIF()
-
-
- ############
-
- SET(TEST_NAME gdfreader)
- SET(SCENARIO_TO_TEST "${TEST_NAME}-test.xml")
-
- ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "output_gdf*.csv")
- ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" ${SCENARIO_TO_TEST})
- ADD_TEST(compare_${TEST_NAME}_125 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf125.csv" "test_gdfX.ref.csv" 0.0001)
- ADD_TEST(compare_${TEST_NAME}_211 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf211.csv" "test_gdfX.ref.csv" 0.0001)
- ADD_TEST(compare_${TEST_NAME}_221 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf221.csv" "test_gdfX.ref.csv" 0.0001)
- ADD_TEST(compare_${TEST_NAME}_222 "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "output_gdf222.csv" "test_gdfX.ref.csv" 0.0001)
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_CONFIG_SUBDIR})
-
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_125 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf125.csv")
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_211 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf211.csv")
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_221 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf221.csv")
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_222 PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf222.csv")
-
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_125 PROPERTIES DEPENDS run_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_211 PROPERTIES DEPENDS run_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_221 PROPERTIES DEPENDS run_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_222 PROPERTIES DEPENDS run_${TEST_NAME})
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME})
-
- ##############
-
- SET(TEST_NAME ov-read-write)
- SET(SCENARIO_TO_TEST "${TEST_NAME}-test.xml")
-
- ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "output_ov.ov")
- ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" ${SCENARIO_TO_TEST})
- ADD_TEST(compare_${TEST_NAME} "git" "diff" "--no-index" "../signals/bci-motor-imagery.ov" "output_ov.ov")
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME} PROPERTIES DEPENDS run_${TEST_NAME})
-
- #############
-
- SET(TEST_NAME csv-read-write)
- SET(SCENARIO_TO_TEST "${TEST_NAME}-test.xml")
-
- 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")
- ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--no-session-management" "--invisible" "--play-fast" ${SCENARIO_TO_TEST})
- ADD_TEST(compare_${TEST_NAME}_signal "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_signal.csv" "output_signal.csv" 0.0001)
- ADD_TEST(compare_${TEST_NAME}_matrix "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_streamedmatrix.csv" "output_streamedmatrix.csv" 0.0001)
- ADD_TEST(compare_${TEST_NAME}_stimulation "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_stimulation.csv" "output_stimulation.csv" 0.0001)
- ADD_TEST(compare_${TEST_NAME}_spectrum "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_spectrum.csv" "output_spectrum.csv" 0.0001)
- ADD_TEST(compare_${TEST_NAME}_features "$ENV{OV_BINARY_PATH}/test_thresholdDataComparison.${EXT}" ${OS_FLAGS} "input_features.csv" "output_features.csv" 0.0001)
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_signal PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_matrix PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_stimulation PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_spectrum PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_features PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_signal PROPERTIES DEPENDS run_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_matrix PROPERTIES DEPENDS run_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_stimulation PROPERTIES DEPENDS run_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_spectrum PROPERTIES DEPENDS run_${TEST_NAME})
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}_features PROPERTIES DEPENDS run_${TEST_NAME})
-
- ###################
-
- #
- # 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').
- # Finally, the CSV "1" and CSV "2" are compared for equality, both for signals and stimulations.
- #
- # 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?
- #
-
- SET(TEST_NAME gdf-readwrite)
-
- ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "output*.csv" "output*.gdf")
- 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")
- 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")
- 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")
-
- 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)
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
-
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}-signal PROPERTIES ATTACHED_FILES_ON_FAIL "output_gdf_signal_1.csv" "output_gdf_signal_2.csv")
-
- SET_TESTS_PROPERTIES(run_${TEST_NAME}-1 PROPERTIES DEPENDS clean_${TEST_NAME})
- SET_TESTS_PROPERTIES(run_${TEST_NAME}-2 PROPERTIES DEPENDS run_${TEST_NAME}-1)
- SET_TESTS_PROPERTIES(run_${TEST_NAME}-3 PROPERTIES DEPENDS run_${TEST_NAME}-2)
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}-signal PROPERTIES DEPENDS run_${TEST_NAME}-3)
- SET_TESTS_PROPERTIES(compare_${TEST_NAME}-stim PROPERTIES DEPENDS run_${TEST_NAME}-3)
-
|