Commit 1222f74c authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED pass all files using a specific "::" separator

CMake was passing arguments separated with space, and only the first expected output file was used
parent 12e8f67f
......@@ -145,11 +145,21 @@ macro(camitk_add_integration_test)
endif()
#-- and add the test
# Construct a specific string for outputfiles to pass them properly to the test command
unset(CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES_ARG)
foreach(TEST_EXPECTED_OUTPUT_FILE ${CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES})
# add specific "::" separator
if(CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES_ARG)
string(CONCAT CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES_ARG "${CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES_ARG}::${TEST_EXPECTED_OUTPUT_FILE}")
else()
set(CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES_ARG ${TEST_EXPECTED_OUTPUT_FILE})
endif()
endforeach()
add_test(NAME ${CAMITK_INTEGRATION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DCAMITK_TEST_COMMAND=${CAMITK_INTEGRATION_TEST_EXECUTABLE}
-DCAMITK_TEST_COMMAND_ARG=${CAMITK_TEST_EXECUTABLE_ARG}
-DCAMITK_TEST_EXPECTED_FILES=${CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES}
-DCAMITK_TEST_EXPECTED_FILES=${CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES_ARG}
-DCAMITK_TEST_OUTPUT_DIR=${CAMITK_TEST_OUTPUT_DIR}
-DCAMITK_TEST_NAME=${CAMITK_INTEGRATION_TEST_NAME}
-P ${CAMITK_CMAKE_MACRO_PATH}/CamiTKTestActionStateMachine.cmake
......
......@@ -67,13 +67,16 @@ execute_process(
file(WRITE ${CAMITK_TEST_COMMAND_RESULT_FILE} ${CAMITK_TEST_COMMAND_RESULT})
file(WRITE ${CAMITK_TEST_COMMAND_OUTPUT_FILE} ${CAMITK_TEST_COMMAND_OUTPUT})
set(CAMITK_TEST_EXPECTED_FILE_OUTPUT "Action state machine regression test called with:\n - CAMITK_TEST_NAME=${CAMITK_TEST_NAME}\n - CAMITK_TEST_COMMAND=${CMAKE_BINARY_DIR}/bin/camitk-actionstatemachine\n - CAMITK_TEST_COMMAND_ARG=${CAMITK_TEST_COMMAND_ARG}\n - CAMITK_TEST_EXPECTED_FILES=${CAMITK_TEST_EXPECTED_FILES}\n - CAMITK_TEST_OUTPUT_DIR=${CAMITK_TEST_OUTPUT_DIR}\n")
# Transform back the "::" separated list of expected output to a classic ";" separated string
string(REPLACE "::" ";" CAMITK_TEST_EXPECTED_FILES_LIST ${CAMITK_TEST_EXPECTED_FILES})
set(CAMITK_TEST_EXPECTED_FILE_OUTPUT "Action state machine regression test called with:\n - CAMITK_TEST_NAME=${CAMITK_TEST_NAME}\n - CAMITK_TEST_COMMAND=${CMAKE_BINARY_DIR}/bin/camitk-actionstatemachine\n - CAMITK_TEST_COMMAND_ARG=${CAMITK_TEST_COMMAND_ARG}\n - CAMITK_TEST_EXPECTED_FILES=${CAMITK_TEST_EXPECTED_FILES_LIST}\n - CAMITK_TEST_OUTPUT_DIR=${CAMITK_TEST_OUTPUT_DIR}\n")
set(CAMITK_TEST_EXPECTED_FILE_RESULT 0)
set(CAMITK_TEST_EXPECTED_FILE_COMMAND)
set(CAMITK_TEST_FAILED_FILE)
#-- Then compare each expected output
foreach(EXPECTED_OUTPUT_FILE ${CAMITK_TEST_EXPECTED_FILES})
foreach(EXPECTED_OUTPUT_FILE ${CAMITK_TEST_EXPECTED_FILES_LIST})
# find the same file in the asm output directory (*T*)
file(GLOB_RECURSE OUTPUT_FILE "${CAMITK_TEST_OUTPUT_DIR}/*T*/${EXPECTED_OUTPUT_FILE}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment