@@ -91,6 +91,7 @@ def test_ios_platforms(tmp_path, build_config, monkeypatch, capfd):
9191 assert "'does-exist' will be included in the cross-build environment" in captured .out
9292
9393
94+ @pytest .mark .serial
9495def test_no_test_sources (tmp_path , capfd ):
9596 """Build will provide a helpful error if pytest is run and test-sources is not defined."""
9697 if utils .get_platform () != "macos" :
@@ -123,6 +124,35 @@ def test_no_test_sources(tmp_path, capfd):
123124 )
124125
125126
127+ def test_ios_testing_with_placeholder (tmp_path , capfd ):
128+ """Build will run tests with the {project} placeholder."""
129+ if utils .get_platform () != "macos" :
130+ pytest .skip ("this test can only run on macOS" )
131+ if utils .get_xcode_version () < (13 , 0 ):
132+ pytest .skip ("this test only works with Xcode 13.0 or greater" )
133+
134+ project_dir = tmp_path / "project"
135+ basic_project = test_projects .new_c_project ()
136+ basic_project .files .update (basic_project_files )
137+ basic_project .generate (project_dir )
138+
139+ with pytest .raises (subprocess .CalledProcessError ):
140+ utils .cibuildwheel_run (
141+ project_dir ,
142+ add_env = {
143+ "CIBW_PLATFORM" : "ios" ,
144+ "CIBW_BUILD" : "cp313-*" ,
145+ "CIBW_TEST_REQUIRES" : "pytest" ,
146+ "CIBW_TEST_COMMAND" : "pytest {project}/tests" ,
147+ "CIBW_XBUILD_TOOLS" : "" ,
148+ },
149+ )
150+
151+ # The error message indicates the configuration issue.
152+ captured = capfd .readouterr ()
153+ assert "iOS tests cannot use placeholders" in captured .out + captured .err
154+
155+
126156def test_missing_xbuild_tool (tmp_path , capfd ):
127157 """Build will fail if xbuild-tools references a non-existent tool."""
128158 if utils .get_platform () != "macos" :
0 commit comments