...
 
Commits (1)
...@@ -68,6 +68,11 @@ if(NOT DEFINED IMAGE_NAME) ...@@ -68,6 +68,11 @@ if(NOT DEFINED IMAGE_NAME)
endif() endif()
set (CTEST_SITE "${IMAGE_NAME}") set (CTEST_SITE "${IMAGE_NAME}")
# Detect "skip testing"
if(DEFINED ENV{CI_SKIP_TESTING})
set(ci_skip_testing 1)
endif()
# Directory variable # Directory variable
set (CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}") set (CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}")
if(BUILD_DIR) if(BUILD_DIR)
...@@ -130,10 +135,15 @@ if ( NOT _build_rv EQUAL 0 ) ...@@ -130,10 +135,15 @@ if ( NOT _build_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_build.") message( SEND_ERROR "An error occurs during ctest_build.")
endif() endif()
ctest_test(PARALLEL_LEVEL 8 if(ci_skip_testing)
RETURN_VALUE _test_rv message(STATUS "Skip testing")
CAPTURE_CMAKE_ERROR _test_error set(_test_rv 0)
) else()
ctest_test(PARALLEL_LEVEL 8
RETURN_VALUE _test_rv
CAPTURE_CMAKE_ERROR _test_error
)
endif()
if ( NOT _test_rv EQUAL 0 ) if ( NOT _test_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_test.") message( SEND_ERROR "An error occurs during ctest_test.")
......