Commit 22ad548f authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED cleanup after rebase

parent 967ea2fd
......@@ -10,19 +10,8 @@ camitk_extension(ACTION_EXTENSION
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
set(SHIBOKEN_CAMITK_SDK_PATH ${SHIBOKEN_CAMITK_SDK_PATH}:${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "")
# add a specific test to run the action, save the output and compare it to expected
camitk_add_test_actionstatemachine(NAME action-reconstruction-functional-test
CAMITK_SCXML action-reconstruction-functional-test.xml
EXPECTED_OUTPUT_FILES action-reconstruction-output-test.vtk)
# On Ubuntu 16.04 LTS, the default VTK version is 6.2 not 6.3
# VTK6.2 has a bug when it saves vtk files: it does not save the proper VTK file format version
# These tests are disabled until Ubuntu LTS 18.04 is released (LTS 18.04 contains VTK 6.3)
if("${VTK_VERSION}" VERSION_LESS 6.3)
set_tests_properties(action-reconstruction-functional-test PROPERTIES WILL_FAIL true)
endif()
# Tests fail due to OpenGL crashing when used inside a VM
if(WIN32)
set_tests_properties(action-reconstruction-functional-test PROPERTIES WILL_FAIL true)
set_tests_properties(action-reconstruction-integration-test PROPERTIES WILL_FAIL true)
endif()
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://camitk.imag.fr/3/smallScxml" initial="Initialize" xmlns:camitk="http://camitk.imag.fr/3/asm" xsi:schemaLocation="http://camitk.imag.fr/3/smallScxml/../resources/smallScxml.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<state id="Initialize">
<onentry>
......@@ -19,7 +20,7 @@
<camitk:parameter name="File name" value="" type="QString"/>
This should not appear.
-->
<camitk:parameter name="File Name" value="action-reconstruction-input.mha" type="QString"/>
<camitk:parameter name="File Name" value="input-1.mha" type="QString"/>
</camitk:parameters>
<camitk:parameters/>
<camitk:outputs>
......@@ -50,7 +51,7 @@
<camitk:component name="image" type="ImageComponent"/>
</camitk:inputs>
<camitk:outputs>
<camitk:component name="action-reconstruction-output-test.vtk" type="MeshComponent"/>
<camitk:component name="output-1.vtk" type="MeshComponent"/>
</camitk:outputs>
</camitk:action>
</camitk:onState>
......@@ -72,7 +73,7 @@
<camitk:name>Save</camitk:name>
<camitk:parameters/>
<camitk:inputs>
<camitk:component name="action-reconstruction-output-test.vtk" type="MeshComponent"/>
<camitk:component name="output-1.vtk" type="MeshComponent"/>
</camitk:inputs>
</camitk:action>
</camitk:onState>
......@@ -81,7 +82,7 @@
<transition target="Action 2" event="Back">
<onTransition>
<camitk:close>
<camitk:component name="action-reconstruction-output-test.vtk" type="MeshComponent"/>
<camitk:component name="output-1.vtk" type="MeshComponent"/>
</camitk:close>
</onTransition>
</transition>
......@@ -96,7 +97,7 @@
<onTransition>
<camitk:close>
<camitk:component name="image" type="ImageComponent"/>
<camitk:component name="action-reconstruction-output-test.vtk" type="MeshComponent"/>
<camitk:component name="output-1.vtk" type="MeshComponent"/>
</camitk:close>
</onTransition>
</transition>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -27,11 +27,11 @@
macro(camitk_add_integration_test)
#-- set the name of the current test and other parameters
if (NOT EXISTS ${SDK_TOP_LEVEL_SOURCE_DIR})
set(CAMITK_INTEGRATION_TEST_NAME ${TYPE_EXTENSION}-${EXTENSION_NAME}-integration-test)
#-- check integration data availability
set(CAMITK_INTEGRATION_TESTDATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/integration-testdata)
# inside communityedition but not in sdk (modeling or imaging)
if (NOT EXISTS ${CAMITK_INTEGRATION_TESTDATA_DIR})
message(FATAL_ERROR "Can not add test ${CAMITK_INTEGRATION_TEST_NAME}: \"integration-testdata\" subdirectory not found." )
endif()
......@@ -62,11 +62,11 @@ macro(camitk_add_integration_test)
# for each lines that have a non-empty "File Name" parameter
foreach(CURRENT_LINE ${FILENAME_LINES})
# first replace the file name so that the file can be copied to the temp directory
string(REGEX REPLACE "value=\"(.*)\"" "value=\"${CAMITK_TEST_OUTPUT_DIR}/\\1\"" CURRENT_LINE_OK "${CURRENT_LINE}")
string(REGEX REPLACE "value=\"(.*)\"" "value=\"${CAMITK_TEST_OUTPUT_DIR}/\\1\"" CURRENT_LINE_OK ${CURRENT_LINE})
# second replace the line in ASM_INPUT_FILE_AS_STRING_OK
string(REPLACE "${CURRENT_LINE}" "${CURRENT_LINE_OK}" ASM_INPUT_FILE_AS_STRING_OK "${ASM_INPUT_FILE_AS_STRING_OK}")
# extract the File Name
string(REGEX REPLACE ".*value=\"(.*)\" .*" "\\1" INPUT_FILE_NAME "${CURRENT_LINE}")
string(REGEX REPLACE ".*value=\"(.*)\" .*" "\\1" INPUT_FILE_NAME ${CURRENT_LINE})
# copy the corresponding file to the temp directory
# message("===== Input File = ${INPUT_FILE_NAME}")
file(COPY ${CAMITK_INTEGRATION_TESTDATA_DIR}/${INPUT_FILE_NAME}
......@@ -88,60 +88,36 @@ macro(camitk_add_integration_test)
#-- run actionstatemachine
set(CAMITK_TEST_EXECUTABLE_ARG "-f ${CAMITK_TEST_OUTPUT_DIR}/${CAMITK_INTEGRATION_SCXML} -o ${CAMITK_TEST_OUTPUT_DIR} -a")
# determine path to camitk-actionstatemachine executable
if(NOT CAMITK_COMMUNITY_EDITION_BUILD)
# this macro is called outside the CE build
set(CAMITK_ASM_EXE ${CAMITK_BIN_DIR}/camitk-actionstatemachine)
if (WIN32 AND NOT EXISTS ${CAMITK_ASM_EXE})
set(CAMITK_ASM_EXE ${CAMITK_BIN_DIR}/camitk-actionstatemachine${CAMITK_DEBUG_POSTFIX})
#-- determine cmake macro path
if (NOT EXISTS SDK_TOP_LEVEL_SOURCE_DIR)
# this macro is called outside the sdk
set(CAMITK_CMAKE_MACRO_PATH ${CAMITK_CMAKE_DIR}/modules/macros/camitk/test)
if(NOT IS_DIRECTORY ${CAMITK_CMAKE_MACRO_PATH})
# inside opensource but not in sdk (modeling or imaging)
set(CAMITK_CMAKE_MACRO_PATH ${CMAKE_SOURCE_DIR}/sdk/cmake/modules/macros/camitk/test)
endif()
else()
# in CE build, use the binary dir version
set(CAMITK_ASM_EXE ${CMAKE_BINARY_DIR}/bin/camitk-actionstatemachine)
# determine which version of the executable to use (debug-suffixed or not)
if(MSVC)
if(NOT CMAKE_BUILD_TYPE)
# Assume the developer that is running the communityedition test suite compiled everything in Debug
set(CAMITK_ASM_EXE ${CAMITK_ASM_EXE}${CAMITK_DEBUG_POSTFIX})
else()
# support multiplaform (sometimes the "Debug" type is all uppercase, as on Win32, sometimes it is Camelcase)
string(TOUPPER ${CMAKE_BUILD_TYPE} CAMITK_BUILD_TYPE_UPPER)
if (CAMITK_BUILD_TYPE_UPPER STREQUAL "DEBUG")
# manage debug build only
set(CAMITK_ASM_EXE ${CAMITK_ASM_EXE}${CAMITK_DEBUG_POSTFIX})
endif()
# if build type is not debug, everything is ok as CAMITK_ASM_EXE is already set to the non-suffixed version
endif()
endif()
# directly use the macro source dir
set(CAMITK_CMAKE_MACRO_PATH ${SDK_TOP_LEVEL_SOURCE_DIR}/cmake/modules/macros/camitk/test)
endif()
# if CE is not being build and actionstationmachine executable cannot be found, this test can be added
if(NOT CAMITK_COMMUNITY_EDITION_BUILD AND NOT EXISTS ${CAMITK_ASM_EXE})
message(WARNING "Cannot add test \"${CAMITK_ADD_TEST_ASM_NAME}\": camitk-actionstatemachine executable not found.")
else()
# all ok, add the test (either outside sdk build and asm is found or inside sdk build)
add_test(NAME ${CAMITK_ADD_TEST_ASM_NAME}
COMMAND ${CMAKE_COMMAND}
-DCAMITK_TEST_COMMAND=${CAMITK_ASM_EXE}
#-- and add the test
add_test(NAME ${CAMITK_INTEGRATION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DCAMITK_TEST_COMMAND=${CMAKE_BINARY_DIR}/bin/camitk-actionstatemachine
-DCAMITK_TEST_COMMAND_ARG=${CAMITK_TEST_EXECUTABLE_ARG}
-DCAMITK_TEST_EXPECTED_FILES=${CAMITK_INTEGRATION_TEST_EXPECTED_OUTPUT_FILES}
-DCAMITK_TEST_OUTPUT_DIR=${CAMITK_TEST_OUTPUT_DIR}
-DCAMITK_TEST_NAME=${CAMITK_INTEGRATION_TEST_NAME}
-P ${CAMITK_CMAKE_MACRO_PATH}/CamiTKTestActionStateMachine.cmake
)
# set the label for tests / associate tests to a project name in CDash
if( CAMITK_ADD_TEST_PROJECT_NAME )
set_tests_properties( ${CAMITK_ADD_TEST_ASM_NAME} PROPERTIES LABELS ${CAMITK_ADD_TEST_PROJECT_NAME} )#
else()
set_tests_properties( ${CAMITK_ADD_TEST_ASM_NAME} PROPERTIES LABELS ${CAMITK_ADD_TEST_ASM_NAME} )
endif()
endif()
# # make sure that camitk-actionstatemachine is build
# if(NOT TARGET application-cepgenerator-bash-test)
# message(FATAL_ERROR "Test application-cepgenerator-bash-test does not exists.")
# endif()
# set_tests_properties(${CAMITK_INTEGRATION_TEST_NAME} PROPERTIES DEPENDS application-cepgenerator-bash-test)
-P ${CAMITK_CMAKE_MACRO_PATH}/CamiTKTestActionStateMachine.cmake
)
# set the label for tests / associate tests to a project name in CDash
if( CAMITK_ADD_TEST_PROJECT_NAME )
set_tests_properties( ${CAMITK_INTEGRATION_TEST_NAME} PROPERTIES LABELS ${CAMITK_ADD_TEST_PROJECT_NAME} )#
else()
set_tests_properties( ${CAMITK_INTEGRATION_TEST_NAME} PROPERTIES LABELS ${CAMITK_INTEGRATION_TEST_NAME} )
endif()
endmacro()
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