@@ -33,6 +33,10 @@ if(CMakePythonDistributions_SUPERBUILD)
33
33
34
34
option (BUILD_VERBOSE "Build reporting additional information (e.g download progress, ...)" ON )
35
35
36
+ option (RUN_CMAKE_TEST "Run CMake test suite when built from sources" ON )
37
+
38
+ set (RUN_CMAKE_TEST_EXCLUDE "BootstrapTest" CACHE STRING "CMake test suite exclusion regex" )
39
+
36
40
set (CMakePythonDistributions_ARCHIVE_DOWNLOAD_DIR "${CMAKE_BINARY_DIR} "
37
41
CACHE PATH "Directory where to download archives"
38
42
)
@@ -311,15 +315,17 @@ set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\
311
315
)
312
316
set (CMAKEPROJECT_BUILD_LAST_STEP "strip_executables" )
313
317
endif ()
314
- # TODO probably want to make this conditional
315
- ExternalProject_Add_Step (CMakeProject-build run_cmake_test_suite
316
- DEPENDEES ${CMAKEPROJECT_BUILD_LAST_STEP}
317
- COMMENT "Running CMake test suite"
318
- COMMAND ./bin/ctest --force-new-ctest-process --stop-on-failure --output-on-failure -j2 -E BootstrapTest
319
- WORKING_DIRECTORY ${CMakeProject_BINARY_DIR}
320
- USES_TERMINAL 1
321
- )
322
- set (CMAKEPROJECT_BUILD_LAST_STEP "run_cmake_test_suite" )
318
+
319
+ if (RUN_CMAKE_TEST )
320
+ ExternalProject_Add_Step (CMakeProject-build run_cmake_test_suite
321
+ DEPENDEES ${CMAKEPROJECT_BUILD_LAST_STEP}
322
+ COMMENT "Running CMake test suite, exclusion list: '${RUN_CMAKE_TEST_EXCLUDE} '"
323
+ COMMAND ./bin/ctest --force-new-ctest-process --stop-on-failure --output-on-failure -j2 -E ${RUN_CMAKE_TEST_EXCLUDE}
324
+ WORKING_DIRECTORY ${CMakeProject_BINARY_DIR}
325
+ USES_TERMINAL 1
326
+ )
327
+ set (CMAKEPROJECT_BUILD_LAST_STEP "run_cmake_test_suite" )
328
+ endif ()
323
329
else ()
324
330
cpd_ExternalProject_Add_Empty (CMakeProject-build "CMakeProject-src-download" )
325
331
endif ()
0 commit comments