Commit c11d1058 authored by Rashad Kanavath's avatar Rashad Kanavath

TEST: run a configure on examples

parent 1739f40e
if(NOT SRC_DIR)
message(FATAL_ERROR "SRC_DIR=${SRC_DIR}")
endif()
set(PKG_DIR)
get_filename_component(PKG_DIR ${CMAKE_CURRENT_LIST_DIR} PATH)
set(TEST_DIR ${PKG_DIR}/ex_build)
if(EXISTS "${TEST_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_DIR})
else()
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_DIR})
endif()
message("TEST_DIR=${TEST_DIR}")
message("PKG_DIR=${PKG_DIR}")
message("SRC_DIR=${SRC_DIR}")
execute_process(
COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${PKG_DIR}
${SRC_DIR}
WORKING_DIRECTORY ${TEST_DIR}
RESULT_VARIABLE configure_rv
OUTPUT_VARIABLE configure_ov
ERROR_VARIABLE configure_ov
)
if( configure_rv )
message(FATAL_ERROR "Configure test failed.\nconfigure_ov=${configure_ov}")
return()
endif()
execute_process(COMMAND ${MAKE_PROGRAM} HelloWorldOTB
WORKING_DIRECTORY ${TEST_DIR}
RESULT_VARIABLE build_HelloWorldOTB_rv
OUTPUT_VARIABLE build_HelloWorldOTB_ov
ERROR_VARIABLE build_HelloWorldOTB_ov
)
if( build_HelloWorldOTB_rv )
message(FATAL_ERROR
"Build test failed.\nbuild_HelloWorldOTB_ov=${build_HelloWorldOTB_ov}")
return()
endif()
# execute_process(COMMAND ${MAKE_PROGRAM} Pipeline
# WORKING_DIRECTORY ${TEST_DIR}
# RESULT_VARIABLE build_Pipeline_rv
# OUTPUT_VARIABLE build_Pipeline_ov
# ERROR_VARIABLE build_Pipeline_ov
# )
# if( build_Pipeline_rv )
# message(FATAL_ERROR
# "Build test failed.\nbuild_Pipeline_ov=${build_Pipeline_ov}")
# return()
# endif()
......@@ -97,6 +97,10 @@ macro(installer_files)
DESTINATION ${PKG_STAGE_DIR})
endif()
install(FILES
Files/build_example.cmake
DESTINATION ${PKG_STAGE_DIR}/tools)
#add otb_loader
add_executable(otb_loader ${CMAKE_CURRENT_SOURCE_DIR}/Files/otb_loader.cxx)
......
......@@ -41,7 +41,14 @@ add_test(
WORKING_DIRECTORY ${pkg_extracted_dir}
)
set_tests_properties ( Tu_selftester PROPERTIES DEPENDS Tu_install_package)
add_test(
NAME build_examples
COMMAND ${CMAKE_COMMAND}
-DSRC_DIR=${CMAKE_SOURCE_DIR}/../Examples
-P ${pkg_extracted_dir}/tools/build_example.cmake
WORKING_DIRECTORY ${testing_dir}
)
add_test(
NAME Tu_uninstall_otb
......@@ -49,7 +56,6 @@ add_test(
WORKING_DIRECTORY ${testing_dir}
)
set_tests_properties ( Tu_uninstall_otb PROPERTIES DEPENDS Tu_selftester)
#if(UNIX)
......
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