2026-05-28 00:20:08 +02:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2025-03-12 04:48:35 +08:00
|
|
|
import os
|
|
|
|
|
import platform
|
2025-04-07 14:20:20 +08:00
|
|
|
import shutil
|
2025-03-12 04:48:35 +08:00
|
|
|
import subprocess
|
2025-05-19 03:42:23 +01:00
|
|
|
import textwrap
|
2025-03-12 04:48:35 +08:00
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
from . import test_projects, utils
|
|
|
|
|
|
2026-05-28 00:20:08 +02:00
|
|
|
TYPE_CHECKING = False
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
2025-07-27 06:12:42 -04:00
|
|
|
pytestmark = pytest.mark.ios
|
|
|
|
|
|
|
|
|
|
CIBW_PLATFORM = os.environ.get("CIBW_PLATFORM", "ios")
|
|
|
|
|
if CIBW_PLATFORM != "ios":
|
|
|
|
|
pytest.skip(f"{CIBW_PLATFORM=}", allow_module_level=True)
|
|
|
|
|
|
2025-04-07 14:20:20 +08:00
|
|
|
basic_project_files = {
|
|
|
|
|
"tests/test_platform.py": f"""
|
2025-03-12 04:48:35 +08:00
|
|
|
import platform
|
|
|
|
|
from unittest import TestCase
|
|
|
|
|
|
|
|
|
|
class TestPlatform(TestCase):
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_platform(self) -> None:
|
2025-03-12 04:48:35 +08:00
|
|
|
self.assertEqual(platform.machine(), "{platform.machine()}")
|
|
|
|
|
|
|
|
|
|
"""
|
2025-04-07 14:20:20 +08:00
|
|
|
}
|
2025-03-12 04:48:35 +08:00
|
|
|
|
|
|
|
|
|
2025-05-29 15:52:46 +01:00
|
|
|
def skip_if_ios_testing_not_supported() -> None:
|
|
|
|
|
"""Skip the test if iOS testing is not supported on this machine."""
|
|
|
|
|
if utils.get_platform() != "macos":
|
|
|
|
|
pytest.skip("this test can only run on macOS")
|
|
|
|
|
if utils.get_xcode_version() < (13, 0):
|
|
|
|
|
pytest.skip("this test only works with Xcode 13.0 or greater")
|
|
|
|
|
|
|
|
|
|
|
2025-03-28 22:33:51 +08:00
|
|
|
# iOS tests shouldn't be run in parallel, because they're dependent on calling
|
|
|
|
|
# Xcode, and starting a simulator. These are both multi-threaded operations, and
|
|
|
|
|
# it's easy to overload the CI machine if there are multiple test processes
|
|
|
|
|
# running multithreaded processes. Therefore, they're put in the serial group,
|
|
|
|
|
# which is guaranteed to run single-process.
|
2025-07-31 12:26:17 -04:00
|
|
|
# This can also fail the first time sometimes.
|
2025-03-28 22:33:51 +08:00
|
|
|
@pytest.mark.serial
|
2026-06-05 08:09:16 -04:00
|
|
|
@pytest.mark.flaky(reruns=1)
|
2025-03-12 04:48:35 +08:00
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
"build_config",
|
|
|
|
|
[
|
|
|
|
|
# Default to the pip build frontend
|
|
|
|
|
{"CIBW_PLATFORM": "ios"},
|
|
|
|
|
# Also check the build frontend
|
|
|
|
|
{"CIBW_PLATFORM": "ios", "CIBW_BUILD_FRONTEND": "build"},
|
|
|
|
|
],
|
|
|
|
|
)
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_ios_platforms(
|
|
|
|
|
tmp_path: Path,
|
|
|
|
|
build_config: dict[str, str],
|
|
|
|
|
monkeypatch: pytest.MonkeyPatch,
|
|
|
|
|
capfd: pytest.CaptureFixture[str],
|
|
|
|
|
) -> None:
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-03-12 04:48:35 +08:00
|
|
|
|
2025-04-07 14:20:20 +08:00
|
|
|
# Create a temporary "bin" directory, symlink a tool that we know eixsts
|
|
|
|
|
# (/usr/bin/true) into that location under a name that should be unique,
|
|
|
|
|
# and add the temp bin directory to the PATH.
|
|
|
|
|
tools_dir = tmp_path / "bin"
|
|
|
|
|
tools_dir.mkdir()
|
2026-04-01 10:23:02 -04:00
|
|
|
true_app = shutil.which("true")
|
|
|
|
|
assert true_app is not None
|
|
|
|
|
tools_dir.joinpath("does-exist").symlink_to(true_app)
|
2025-04-07 14:20:20 +08:00
|
|
|
|
|
|
|
|
monkeypatch.setenv("PATH", str(tools_dir), prepend=os.pathsep)
|
|
|
|
|
|
|
|
|
|
# Generate a test project that has an additional before-build step using the
|
|
|
|
|
# known-to-exist tool.
|
2025-03-12 04:48:35 +08:00
|
|
|
project_dir = tmp_path / "project"
|
2025-04-07 14:20:20 +08:00
|
|
|
setup_py_add = "import subprocess\nsubprocess.run('does-exist', check=True)\n"
|
|
|
|
|
basic_project = test_projects.new_c_project(setup_py_add=setup_py_add)
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
2025-03-12 04:48:35 +08:00
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
2025-04-07 14:20:20 +08:00
|
|
|
# Build and test the wheels. Mark the "does-exist" tool as a cross-build
|
|
|
|
|
# tool, and invoke it during a `before-build` step. It will also be invoked
|
|
|
|
|
# when `setup.py` is invoked.
|
|
|
|
|
#
|
|
|
|
|
# Tests are only executed on simulator. The test suite passes if it's
|
|
|
|
|
# running on the same architecture as the current platform.
|
2025-03-12 04:48:35 +08:00
|
|
|
actual_wheels = utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
2025-04-07 14:20:20 +08:00
|
|
|
"CIBW_BEFORE_BUILD": "does-exist",
|
|
|
|
|
"CIBW_XBUILD_TOOLS": "does-exist",
|
2025-03-12 04:48:35 +08:00
|
|
|
"CIBW_TEST_SOURCES": "tests",
|
2025-05-30 09:53:20 -04:00
|
|
|
"CIBW_TEST_COMMAND": "python -m this && python -m unittest discover tests test_platform.py",
|
2025-03-28 22:33:51 +08:00
|
|
|
"CIBW_BUILD_VERBOSITY": "1",
|
2025-03-12 04:48:35 +08:00
|
|
|
**build_config,
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
2025-04-07 14:20:20 +08:00
|
|
|
# The expected wheels were produced.
|
2025-09-08 15:58:03 +01:00
|
|
|
expected_wheels = utils.expected_wheels("spam", "0.1.0", platform="ios")
|
2025-05-19 03:42:23 +01:00
|
|
|
assert set(actual_wheels) == set(expected_wheels)
|
2025-03-12 04:48:35 +08:00
|
|
|
|
2025-04-07 14:20:20 +08:00
|
|
|
# The user was notified that the cross-build tool was found.
|
|
|
|
|
captured = capfd.readouterr()
|
|
|
|
|
assert "'does-exist' will be included in the cross-build environment" in captured.out
|
|
|
|
|
|
2025-05-30 09:53:20 -04:00
|
|
|
# Make sure the first command ran
|
|
|
|
|
assert "Zen of Python" in captured.out
|
|
|
|
|
|
2025-03-12 04:48:35 +08:00
|
|
|
|
2025-05-28 16:05:16 +01:00
|
|
|
@pytest.mark.serial
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_no_test_sources(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
2025-05-28 16:05:16 +01:00
|
|
|
"""Build will provide a helpful error if pytest is run and test-sources is not defined."""
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-03-12 04:48:35 +08:00
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
2025-04-07 14:20:20 +08:00
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
2025-03-12 04:48:35 +08:00
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
with pytest.raises(subprocess.CalledProcessError):
|
|
|
|
|
utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
2025-05-28 16:05:16 +01:00
|
|
|
"CIBW_TEST_REQUIRES": "pytest",
|
|
|
|
|
"CIBW_TEST_COMMAND": "python -m pytest",
|
|
|
|
|
"CIBW_XBUILD_TOOLS": "",
|
2025-03-12 04:48:35 +08:00
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
2025-04-07 14:20:20 +08:00
|
|
|
# The error message indicates the configuration issue.
|
2025-03-12 04:48:35 +08:00
|
|
|
captured = capfd.readouterr()
|
2025-05-28 16:05:16 +01:00
|
|
|
assert (
|
|
|
|
|
"you must copy your test files to the testbed app by setting the `test-sources` option"
|
|
|
|
|
in captured.out + captured.err
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_ios_testing_with_placeholder(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
2025-05-30 09:53:20 -04:00
|
|
|
"""
|
|
|
|
|
Tests with the {project} placeholder are not supported on iOS, because the test command
|
|
|
|
|
is run in the simulator.
|
|
|
|
|
"""
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-05-28 16:05:16 +01:00
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
|
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
with pytest.raises(subprocess.CalledProcessError):
|
|
|
|
|
utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
|
|
|
|
"CIBW_TEST_REQUIRES": "pytest",
|
|
|
|
|
"CIBW_TEST_COMMAND": "pytest {project}/tests",
|
|
|
|
|
"CIBW_XBUILD_TOOLS": "",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# The error message indicates the configuration issue.
|
|
|
|
|
captured = capfd.readouterr()
|
|
|
|
|
assert "iOS tests cannot use placeholders" in captured.out + captured.err
|
2025-04-07 14:20:20 +08:00
|
|
|
|
|
|
|
|
|
2025-05-30 09:53:20 -04:00
|
|
|
@pytest.mark.serial
|
2026-06-05 08:09:16 -04:00
|
|
|
@pytest.mark.flaky(reruns=1)
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_ios_test_command_short_circuit(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
2025-05-30 09:53:20 -04:00
|
|
|
skip_if_ios_testing_not_supported()
|
|
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
|
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
with pytest.raises(subprocess.CalledProcessError):
|
|
|
|
|
# `python -m not_a_module` will fail, so `python -m this` should not be run.
|
|
|
|
|
utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
|
|
|
|
"CIBW_XBUILD_TOOLS": "",
|
|
|
|
|
"CIBW_TEST_SOURCES": "tests",
|
|
|
|
|
"CIBW_TEST_COMMAND": "python -m not_a_module && python -m this",
|
|
|
|
|
"CIBW_BUILD_VERBOSITY": "1",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
captured = capfd.readouterr()
|
|
|
|
|
|
|
|
|
|
assert "No module named not_a_module" in captured.out + captured.err
|
|
|
|
|
# assert that `python -m this` was not run
|
|
|
|
|
assert "Zen of Python" not in captured.out + captured.err
|
|
|
|
|
|
|
|
|
|
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_missing_xbuild_tool(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
2025-04-07 14:20:20 +08:00
|
|
|
"""Build will fail if xbuild-tools references a non-existent tool."""
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-04-07 14:20:20 +08:00
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
|
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
with pytest.raises(subprocess.CalledProcessError):
|
|
|
|
|
utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
2025-05-19 03:42:23 +01:00
|
|
|
"CIBW_TEST_COMMAND": "python -m tests",
|
2025-04-07 14:20:20 +08:00
|
|
|
"CIBW_XBUILD_TOOLS": "does-not-exist",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# The error message indicates the problem tool.
|
|
|
|
|
captured = capfd.readouterr()
|
|
|
|
|
assert "Could not find a 'does-not-exist' executable on the path." in captured.err
|
|
|
|
|
|
|
|
|
|
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_no_xbuild_tool_definition(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
2025-04-07 14:20:20 +08:00
|
|
|
"""Build will succeed with a warning if there is no xbuild-tools definition."""
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-04-07 14:20:20 +08:00
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
|
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
# Build, but don't test the wheels; we're only checking that the right
|
|
|
|
|
# warning was raised.
|
|
|
|
|
actual_wheels = utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
2025-07-28 07:15:55 +02:00
|
|
|
"CIBW_BUILD": "cp313-*",
|
2025-04-07 14:20:20 +08:00
|
|
|
"CIBW_TEST_SKIP": "*",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# The expected wheels were produced.
|
2025-05-19 03:42:23 +01:00
|
|
|
expected_wheels = utils.expected_wheels(
|
|
|
|
|
"spam",
|
|
|
|
|
"0.1.0",
|
|
|
|
|
platform="ios",
|
2025-07-28 07:15:55 +02:00
|
|
|
python_abi_tags=["cp313-cp313"],
|
2025-05-19 03:42:23 +01:00
|
|
|
)
|
|
|
|
|
assert set(actual_wheels) == set(expected_wheels)
|
2025-04-07 14:20:20 +08:00
|
|
|
|
|
|
|
|
# The user was notified that there was no cross-build tool definition.
|
|
|
|
|
captured = capfd.readouterr()
|
|
|
|
|
assert "Your project configuration does not define any cross-build tools." in captured.err
|
|
|
|
|
|
|
|
|
|
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_empty_xbuild_tool_definition(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
2025-04-07 14:20:20 +08:00
|
|
|
"""Build will succeed with no warning if there is an empty xbuild-tools definition."""
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-04-07 14:20:20 +08:00
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
|
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
# Build, but don't test the wheels; we're only checking that a warning
|
|
|
|
|
# wasn't raised.
|
|
|
|
|
actual_wheels = utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
2025-07-28 07:15:55 +02:00
|
|
|
"CIBW_BUILD": "cp313-*",
|
2025-04-07 14:20:20 +08:00
|
|
|
"CIBW_TEST_SKIP": "*",
|
|
|
|
|
"CIBW_XBUILD_TOOLS": "",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
2025-05-19 03:42:23 +01:00
|
|
|
expected_wheels = utils.expected_wheels(
|
2025-07-28 07:15:55 +02:00
|
|
|
"spam", "0.1.0", platform="ios", python_abi_tags=["cp313-cp313"]
|
2025-05-19 03:42:23 +01:00
|
|
|
)
|
|
|
|
|
assert set(actual_wheels) == set(expected_wheels)
|
2025-04-07 14:20:20 +08:00
|
|
|
|
|
|
|
|
# The warnings about cross-build notifications were silenced.
|
|
|
|
|
captured = capfd.readouterr()
|
|
|
|
|
assert "Your project configuration does not define any cross-build tools." not in captured.err
|
2025-05-19 03:42:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.serial
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_ios_test_command_without_python_dash_m(
|
|
|
|
|
tmp_path: Path, capfd: pytest.CaptureFixture[str]
|
|
|
|
|
) -> None:
|
2025-05-19 03:42:23 +01:00
|
|
|
"""pytest should be able to run without python -m, but it should warn."""
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-05-19 03:42:23 +01:00
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
|
|
|
|
|
project = test_projects.new_c_project()
|
|
|
|
|
project.files["tests/__init__.py"] = ""
|
|
|
|
|
project.files["tests/test_spam.py"] = textwrap.dedent("""
|
|
|
|
|
import spam
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_spam() -> None:
|
2025-05-19 03:42:23 +01:00
|
|
|
assert spam.filter("spam") == 0
|
|
|
|
|
assert spam.filter("ham") != 0
|
|
|
|
|
""")
|
|
|
|
|
project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
actual_wheels = utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
2025-07-28 07:15:55 +02:00
|
|
|
"CIBW_BUILD": "cp313-*",
|
2025-05-19 03:42:23 +01:00
|
|
|
"CIBW_TEST_COMMAND": "pytest ./tests",
|
|
|
|
|
"CIBW_TEST_SOURCES": "tests",
|
|
|
|
|
"CIBW_TEST_REQUIRES": "pytest",
|
|
|
|
|
"CIBW_XBUILD_TOOLS": "",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
expected_wheels = utils.expected_wheels(
|
2025-07-28 07:15:55 +02:00
|
|
|
"spam", "0.1.0", platform="ios", python_abi_tags=["cp313-cp313"]
|
2025-05-19 03:42:23 +01:00
|
|
|
)
|
|
|
|
|
assert set(actual_wheels) == set(expected_wheels)
|
|
|
|
|
|
2025-09-14 23:14:45 +05:30
|
|
|
_, err = capfd.readouterr()
|
2025-05-19 03:42:23 +01:00
|
|
|
|
|
|
|
|
assert "iOS tests configured with a test command which doesn't start with 'python -m'" in err
|
|
|
|
|
|
|
|
|
|
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_ios_test_command_invalid(tmp_path: Path, capfd: pytest.CaptureFixture[str]) -> None:
|
2025-05-19 03:42:23 +01:00
|
|
|
"""Test command should raise an error if it's clearly invalid."""
|
2025-05-29 15:52:46 +01:00
|
|
|
skip_if_ios_testing_not_supported()
|
2025-05-19 03:42:23 +01:00
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files["./my_test_script.sh"] = "echo hello"
|
|
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
with pytest.raises(subprocess.CalledProcessError):
|
|
|
|
|
utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
|
|
|
|
"CIBW_TEST_COMMAND": "./my_test_script.sh",
|
|
|
|
|
"CIBW_TEST_SOURCES": "./my_test_script.sh",
|
|
|
|
|
"CIBW_XBUILD_TOOLS": "",
|
|
|
|
|
},
|
|
|
|
|
)
|
2025-09-14 23:14:45 +05:30
|
|
|
_, err = capfd.readouterr()
|
2025-05-19 03:42:23 +01:00
|
|
|
assert "iOS tests configured with a test command which doesn't start with 'python -m'" in err
|
2026-03-09 20:56:45 +01:00
|
|
|
|
|
|
|
|
|
2026-04-01 10:23:02 -04:00
|
|
|
def test_repair_step(tmp_path: Path) -> None:
|
2026-03-09 20:56:45 +01:00
|
|
|
"""Build will succeed & the custom repair step is called."""
|
|
|
|
|
skip_if_ios_testing_not_supported()
|
|
|
|
|
|
|
|
|
|
project_dir = tmp_path / "project"
|
|
|
|
|
basic_project = test_projects.new_c_project()
|
|
|
|
|
basic_project.files.update(basic_project_files)
|
|
|
|
|
basic_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
# Build, but don't test the wheels; we're only checking that the right
|
|
|
|
|
# warning was raised.
|
|
|
|
|
actual_wheels = utils.cibuildwheel_run(
|
|
|
|
|
project_dir,
|
|
|
|
|
add_env={
|
|
|
|
|
"CIBW_PLATFORM": "ios",
|
|
|
|
|
"CIBW_BUILD": "cp314-*",
|
|
|
|
|
"CIBW_TEST_SKIP": "*",
|
|
|
|
|
"CIBW_REPAIR_WHEEL_COMMAND": "touch .ios-repair-step && mv {wheel} {dest_dir}",
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# The expected wheels were produced.
|
|
|
|
|
expected_wheels = utils.expected_wheels(
|
|
|
|
|
"spam",
|
|
|
|
|
"0.1.0",
|
|
|
|
|
platform="ios",
|
|
|
|
|
python_abi_tags=["cp314-cp314"],
|
|
|
|
|
)
|
|
|
|
|
assert set(actual_wheels) == set(expected_wheels)
|
|
|
|
|
|
|
|
|
|
# The custom repair step is called.
|
|
|
|
|
assert project_dir.joinpath(".ios-repair-step").is_file()
|