123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
-
- #basics definitions needed here
- IF(WIN32)
- SET(EXT cmd)
- SET(OS_FLAGS "--no-pause")
- SET(OS_SUFFIX "")
- ELSE()
- SET(EXT sh)
- SET(OS_FLAGS "")
- SET(OS_SUFFIX "-linux")
- ENDIF()
-
-
- # Simple Test of run-command box
- SET(TEST_NAME test-run-command)
- SET(SCENARIO_TO_TEST "${TEST_NAME}.xml")
- ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "${TEST_NAME}.txt")
- ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--invisible" "--play" ${SCENARIO_TO_TEST})
- ADD_TEST(exist_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "md5sum" "${TEST_NAME}.txt")
-
- ## add some properties that help to debug
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
-
- SET_TESTS_PROPERTIES(exist_${TEST_NAME} PROPERTIES DEPENDS run_${TEST_NAME}})
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME}})
-
-
- # Test run command with spaces
- #
- # This construction is intended to test cases where run command box command has spaces
- # in both executable path and some of the arguments. We use cmake script 'wrap' to get access to the stdout
- # where the results are printed in this case.
- SET(TEST_NAME run-command-with-spaces)
- SET(SCENARIO_TO_TEST "${TEST_NAME}.xml")
- ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "${TEST_NAME}.txt")
- ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--invisible" "--no-session-management" "-d" "EXT" "${EXT}" "-d" "OUTFILE" "${TEST_NAME}.txt" "--play" ${SCENARIO_TO_TEST})
- ADD_TEST(compare_${TEST_NAME} "git" "diff" "--no-index" "--ignore-space-at-eol" "${TEST_NAME}${OS_SUFFIX}.ref.txt" "${TEST_NAME}.txt")
-
- ## add some properties that help to debug
- SET_TESTS_PROPERTIES(run_$ENV{OV_TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(exist_${TEST_NAME} PROPERTIES DEPENDS run_${TEST_NAME}})
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME}})
-
- # Simple Test of timeout box
- SET(TEST_NAME test-timeout)
- SET(SCENARIO_TO_TEST "${TEST_NAME}.xml")
- ADD_TEST(clean_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "remove" "-f" "${TEST_NAME}.txt")
- ADD_TEST(run_${TEST_NAME} "$ENV{OV_BINARY_PATH}/openvibe-designer.${EXT}" ${OS_FLAGS} "--invisible" "--play" ${SCENARIO_TO_TEST})
- ADD_TEST(exist_${TEST_NAME} "${CMAKE_COMMAND}" "-E" "md5sum" "${TEST_NAME}.txt")
-
- ## add some properties that help to debug
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES ATTACHED_FILES_ON_FAIL ${OV_LOGFILE})
- SET_TESTS_PROPERTIES(exist_${TEST_NAME} PROPERTIES DEPENDS run_${TEST_NAME}})
- SET_TESTS_PROPERTIES(run_${TEST_NAME} PROPERTIES DEPENDS clean_${TEST_NAME}})
|