Skip to content

Commit 01b3c2d

Browse files
committed
exclude some tests on musllinux
Default is to exclude only `BootstrapTest` On musllinux, also exclude `ExportImport`, `RunCMake.install` & `RunCMake.file-GET_RUNTIME_DEPENDENCIES`
1 parent 9a5c208 commit 01b3c2d

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

CMakeLists.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ if(CMakePythonDistributions_SUPERBUILD)
3333

3434
option(BUILD_VERBOSE "Build reporting additional information (e.g download progress, ...)" ON)
3535

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+
3640
set(CMakePythonDistributions_ARCHIVE_DOWNLOAD_DIR "${CMAKE_BINARY_DIR}"
3741
CACHE PATH "Directory where to download archives"
3842
)
@@ -311,15 +315,17 @@ set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\
311315
)
312316
set(CMAKEPROJECT_BUILD_LAST_STEP "strip_executables")
313317
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()
323329
else()
324330
cpd_ExternalProject_Add_Empty(CMakeProject-build "CMakeProject-src-download")
325331
endif()

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ before-all = [
2828
"ninja --version",
2929
"./scripts/manylinux-build-and-install-openssl.sh",
3030
]
31+
environment = { SKBUILD_CONFIGURE_OPTIONS = "-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl -DCMAKE_JOB_POOL_COMPILE:STRING=compile -DCMAKE_JOB_POOL_LINK:STRING=link -DCMAKE_JOB_POOLS:STRING=compile=2;link=1 -DCMAKE_CXX_STANDARD:STRING=11" }
3132

32-
[tool.cibuildwheel.linux.environment]
33-
SKBUILD_CONFIGURE_OPTIONS = "-DCMAKE_CXX_STANDARD:STRING=11 -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl -DCMAKE_JOB_POOL_COMPILE:STRING=compile -DCMAKE_JOB_POOL_LINK:STRING=link -DCMAKE_JOB_POOLS:STRING=compile=2;link=1"
33+
[[tool.cibuildwheel.overrides]]
34+
select = "*-musllinux*"
35+
environment = { SKBUILD_CONFIGURE_OPTIONS = "-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl -DCMAKE_JOB_POOL_COMPILE:STRING=compile -DCMAKE_JOB_POOL_LINK:STRING=link -DCMAKE_JOB_POOLS:STRING=compile=2;link=1 -DRUN_CMAKE_TEST_EXCLUDE:STRING='BootstrapTest|ExportImport|RunCMake.install|RunCMake.file-GET_RUNTIME_DEPENDENCIES'" }
3436

3537
[tool.cibuildwheel.macos.environment]
3638
MACOSX_DEPLOYMENT_TARGET = "10.10"

0 commit comments

Comments
 (0)