Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 72d88a73 authored by lealv's avatar lealv
Browse files

UPDATED - CTEST: activate actions tests on bassin.msh

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1862 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 99fe0419
......@@ -15,6 +15,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME CEP_IMAGING
DESCRIPTION "This action features basic ITK image processing filters"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
......@@ -5,4 +5,5 @@ camitk_extension( ACTION_EXTENSION
CXX_FLAGS "-w"
DESCRIPTION "This action features basic ITK image processing segmentation algorithms"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
\ No newline at end of file
......@@ -6,4 +6,5 @@ camitk_extension(ACTION_EXTENSION
CEP_NAME CEP_MODELING
DESCRIPTION "Action MML features algorithms applicable on MML components."
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
\ No newline at end of file
......@@ -2,5 +2,6 @@
camitk_extension(ACTION_EXTENSION
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
......@@ -3,6 +3,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Control of the arbitrary slice on image component"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -5,6 +5,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Helps you to crop a volume to keep only an interesting subsample"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -3,6 +3,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Displays the image look-up-table (lut)"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -3,4 +3,5 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Re-sample image volumes"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
\ No newline at end of file
......@@ -4,6 +4,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Action-multipicking allows one to make several pixel picking on an image component (volumic image)"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -4,4 +4,5 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Allows changing the color of the image pixels"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
\ No newline at end of file
......@@ -3,6 +3,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Use marching cube algorithm to create a surfacic mesh from a volumic image"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -4,5 +4,6 @@ camitk_extension(ACTION_EXTENSION
NEEDS_COMPONENT_EXTENSION vtkmesh
INCLUDE_DIRECTORIES ../../../components/vtkmesh
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
......@@ -2,6 +2,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Display in 3D the component"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -4,6 +4,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Use ray tracing to produce a 3D reprensation of the image"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -3,6 +3,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Provides basic actions on meshes"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -3,6 +3,7 @@ camitk_extension( ACTION_EXTENSION
CEP_NAME SDK
DESCRIPTION "Helps building simple 3D objects"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -5,6 +5,7 @@ camitk_extension( ACTION_EXTENSION
DESCRIPTION "Features some nice algorithms for mesh processing"
TEST_APPLICATION ${APPLICATION_TEST_ACTION}
INCLUDE_DIRECTORIES ${CAMITK_INCLUDE_DIR}/components/vtkmesh
TEST_FILES bassin.msh
)
# Recursively update the shiboken path variable containing the CamiTK SDK tree structure
......
......@@ -31,6 +31,7 @@
#! [TEST_APPLICATION application-name]
#! [DESCRIPTION description]
#! [EXTRA_TRANSLATE_LANGUAGE]
#! [TEST_FILES file1 file2 ...]
#! )
#! \endcode
#!
......@@ -71,6 +72,7 @@
#! \param TEST_APPLICATION = The name of the application to provide for generate automatic basic tests on your extension. No option means no tests!
#! \param DESCRIPTION = Simple description of the extension. Used for packaging presentation for instance.
#! \param EXTRA_TRANSLATE_LANGUAGE = Additionnal extra language to translate the application
#! \param TEST_FILES = Parameter of TestActions module : REQUIRED. List of files on which the action must applied.
macro(camitk_extension)
......@@ -86,7 +88,7 @@ macro(camitk_extension)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} EXTENSION_NAME)
parse_arguments(${EXTENSION_NAME_CMAKE} #prefix
"NEEDS_TOOL;NEEDS_CEP_LIBRARIES;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;INCLUDE_DIRECTORIES;EXTERNAL_LIBRARIES;HEADERS_TO_INSTALL;DEFINES;CXX_FLAGS;EXTERNAL_SOURCES;TARGET_NAME;CEP_NAME;DESCRIPTION;TEST_APPLICATION;EXTRA_TRANSLATE_LANGUAGE" # possible lists
"NEEDS_TOOL;NEEDS_CEP_LIBRARIES;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;INCLUDE_DIRECTORIES;EXTERNAL_LIBRARIES;HEADERS_TO_INSTALL;DEFINES;CXX_FLAGS;EXTERNAL_SOURCES;TARGET_NAME;CEP_NAME;DESCRIPTION;TEST_APPLICATION;EXTRA_TRANSLATE_LANGUAGE;TEST_FILES" # possible lists
"NEEDS_QT_MODULES;ACTION_EXTENSION;COMPONENT_EXTENSION;DISABLED;NEEDS_XERCESC;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XSD;NEEDS_QTXML;NEEDS_OPENCV;NEEDS_IGSTK;INSTALL_ALL_HEADERS;NEEDS_GDCM;DISABLE_TESTLEVEL1;DISABLE_TESTLEVEL2;DISABLE_TESTLEVEL3" # possible options
${ARGN}
)
......@@ -1466,28 +1468,25 @@ macro(camitk_extension)
get_directory_name( ${CMAKE_CURRENT_SOURCE_DIR} COMP_DIR_NAME )
# Test should pass because application test runs with no arguments - shows usage and exit success
camitk_add_test( TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
# Retrieve the files in ctestdata directory - tests will be applied for each of these files
get_subdirectoryfiles( ${CAMITK_BUILD_TESTDATA_DIR}/ctestdata TESTFILES )
camitk_add_test( TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
#get the names of actions .dlls in lib directory
get_subdirectoryfiles( ${CAMITK_BUILD_PRIVATE_LIB_DIR}/actions/ ACTIONSDLLS )
foreach( ACTION_TESTDATA_FILE ${TESTFILES} )
# Give the file name (full path cut)
get_directory_name( ${ACTION_TESTDATA_FILE} DATA_FILE )
if( NOT ( ${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME} MATCHES "application" ) )#We do not apply tests on actions like (close, save, save as)
# Test procedure: Open a file - load an action extension - Apply an action on the component wrapping the file
if(MSVC)
camitk_add_test( EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/ctestdata/${DATA_FILE} -a lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}${CAMITK_DEBUG_POSTFIX}.dll" TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
elseif(APPLE)
camitk_add_test( EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/ctestdata/${DATA_FILE} -a lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}.dylib" TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
elseif(UNIX)
camitk_add_test( EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/ctestdata/${DATA_FILE} -a lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}.so" TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
endif()
camitk_parse_test_add(NAME ${CAMITK_TEST_NAME} LEVEL 3 DESCRIPTION "Open a file, load the action and apply it on the component.")
endif()
foreach( ACTION_TESTDATA_FILE ${${EXTENSION_NAME_CMAKE}_TEST_FILES} )
message( STATUS "Action extension: " ${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME} " Test file: " ${ACTION_TESTDATA_FILE} )
if( NOT ( ${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME} MATCHES "application" ) )#We do not apply tests on actions like (close, save, save as)
# Test procedure: Open a file - load an action extension - Apply an action on the component wrapping the file
if(MSVC)
camitk_add_test( EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/ctestdata/${DATA_FILE} -a lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}${CAMITK_DEBUG_POSTFIX}.dll" TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
elseif(APPLE)
camitk_add_test( EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/ctestdata/${DATA_FILE} -a lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}.dylib" TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
elseif(UNIX)
camitk_add_test( EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/ctestdata/${DATA_FILE} -a lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}.so" TEST_SUFFIX ${COMP_DIR_NAME} PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} )
endif()
camitk_parse_test_add(NAME ${CAMITK_TEST_NAME} LEVEL 3 DESCRIPTION "Open a file, load the action and apply it on the component.")
endif()
endforeach()
endif()
endif() # endif(${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE})
......
......@@ -389,9 +389,7 @@ Component * Application::open(const QString & fileName) {
resetProgressBar();
if (!comp->isTopLevel())
{
CAMITK_WARNING("Application", "Open", "Instanciating a NON top level component.")
}
return comp;
}
......
......@@ -65,11 +65,11 @@ int main(int argc, char *argv[]) {
|| (o.input() == "" && o.action() == "")
)
{
std::cout << "Help or no arguments: ";
std::cout << "Help or no arguments: " << std::endl;
usage(argv[0]);
}
else if( o.input() == "" || o.action() == "" ) {
std::cout << "Bad arguments: ";
std::cout << "Bad arguments: " << std::endl;
usage(argv[0]);
}
else
......@@ -82,8 +82,8 @@ int main(int argc, char *argv[]) {
// avoid all redirection to console
MainWindow *defaultMainWindow = dynamic_cast<MainWindow*>(a.getMainWindow());
defaultMainWindow->redirectToConsole(false);
// Remember, autoload search for extension dynamic libraries in the lib/actions and lib/components subdirectories of
// Remember, autoload search for extension dynamic libraries in the lib/actions and lib/components subdirectories of
// the following trees:
// * current working directory (build)
// * local installation
......@@ -96,26 +96,29 @@ int main(int argc, char *argv[]) {
if( comp )
{
std::cout << "Component loaded: " << o.input() << std::endl;
std::cout << "Component loaded: " << o.input() << std::endl;
Action::ApplyStatus status;
comp->setSelected( true, true );
// Find the actions directory, according to this application's location
// If the application directory is in the build/bin directory, then the action directory will point on the build/lib/camitk-version/actions directory
// Note : do not use Core::getActionDirectories as it uses Core::getCurrentWorkingDir which is clearly less accurate
QString actionsDirectory = Application::instance()->applicationDirPath() + "/../lib/" + Core::shortVersion + "/actions/";
// If the application directory is in the build/bin directory, then the action directory will point on the build/lib/camitk-version/actions directory
// Note : do not use Core::getActionDirectories as it uses Core::getCurrentWorkingDir which is clearly less accurate
QString actionsDirectory = Application::instance()->applicationDirPath() + "/../lib/" + Core::shortVersion + "/actions/";
//Load the action extension defined in the entry parameters
if (!(actionsDirectory.isEmpty())
&& (ExtensionManager::loadExtension(ExtensionManager::ACTION, actionsDirectory + o.action().data())))
if (!(actionsDirectory.isEmpty())
&& (ExtensionManager::loadExtension(ExtensionManager::ACTION, actionsDirectory + o.action().data())))
{
std::cout << "load action extension "<< o.action().data() << std::endl;
ActionList actl = Application::getActions( comp );
if( !( actl.isEmpty() ))
{
std::cout << "Action list is not empty. " << std::endl;
foreach( Action *action , actl )
{
std::cout << "Test action " << action->getName().toStdString() << std::endl;
action->setInputComponent( comp );
std::cout << action->getName().toStdString() << " call apply() " << std::endl;
status = action->apply();
if( status != Action::SUCCESS )
......@@ -162,5 +165,4 @@ int main(int argc, char *argv[]) {
std::cout << argv[0] << " aborted..." << std::endl << "Unknown Exception" << std::endl;
return EXIT_FAILURE;
}
}
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