Skip to content
Snippets Groups Projects
Commit 8e76119a authored by Administrator's avatar Administrator
Browse files

Don't execute test suite if compilation fails

The CI pipeline should run as fast as possible, so stop a test stage as early
as possible.
parent 4e058891
No related branches found
No related tags found
1 merge request!746Don't execute test suite if compilation fails (#2362)
Pipeline #16410 failed
......@@ -65,7 +65,7 @@ EndIf()
Ctest_Start(${_CMakeModel})
unset(repeat)
If(${CBM_TEST_MODEL} MATCHES MergeRequest OR ${CBM_TEST_MODEL} MATCHES Continuous)
if(${_CMakeModel} MATCHES Continuous)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
set(repeat REPEAT UNTIL_PASS:2)
endif()
......@@ -81,7 +81,10 @@ Ctest_Configure(BUILD "${CTEST_BINARY_DIRECTORY}"
)
If(NOT _RETVAL)
Ctest_Build(BUILD "${CTEST_BINARY_DIRECTORY}")
Ctest_Build(BUILD "${CTEST_BINARY_DIRECTORY}"
NUMBER_ERRORS _NUM_ERROR
)
If(${_CMakeModel} MATCHES Continuous)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
CTest_Submit(PARTS Update Configure Build)
......@@ -90,6 +93,23 @@ If(NOT _RETVAL)
BUILD_ID cdash_build_id
)
EndIf()
if(${_NUM_ERROR} GREATER 0)
If(${CMAKE_VERSION} VERSION_LESS 3.14.0)
Else()
message(STATUS " ")
message(STATUS " You can find the produced results on the CDash server")
message(STATUS " ")
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}"
)
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}"
)
message(STATUS " ")
EndIf()
Message(STATUS "Build finished with ${_NUM_ERROR} errors")
message(FATAL_ERROR "Compilation failure")
endif()
EndIf()
Ctest_Test(BUILD "${CTEST_BINARY_DIRECTORY}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment