Commit 2d026882 authored by Guillaume Pasero's avatar Guillaume Pasero

CI: support skip_testing option

parent 8271c62b
Pipeline #1045 passed with stages
in 37 minutes and 34 seconds
......@@ -68,6 +68,11 @@ if(NOT DEFINED IMAGE_NAME)
endif()
set (CTEST_SITE "${IMAGE_NAME}")
# Detect "skip testing"
if(DEFINED ENV{CI_SKIP_TESTING})
set(ci_skip_testing 1)
endif()
# Directory variable
set (CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}")
if(BUILD_DIR)
......@@ -130,10 +135,15 @@ if ( NOT _build_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_build.")
endif()
ctest_test(PARALLEL_LEVEL 8
RETURN_VALUE _test_rv
CAPTURE_CMAKE_ERROR _test_error
)
if(ci_skip_testing)
message(STATUS "Skip testing")
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 )
message( SEND_ERROR "An error occurs during ctest_test.")
......
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