2020-05-25 14:55:04 +02:00
|
|
|
import textwrap
|
|
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
2021-01-06 13:50:58 -05:00
|
|
|
from . import test_projects, utils
|
2020-05-25 14:55:04 +02:00
|
|
|
|
|
|
|
|
project_with_unicode = test_projects.new_c_project(
|
2021-04-30 17:56:34 -04:00
|
|
|
spam_c_function_add=textwrap.dedent(
|
2021-05-03 11:45:43 -04:00
|
|
|
r"""
|
2020-05-25 14:55:04 +02:00
|
|
|
{
|
|
|
|
|
Py_XDECREF(PyUnicode_FromStringAndSize("foo", 4));
|
|
|
|
|
}
|
2021-05-03 11:45:43 -04:00
|
|
|
"""
|
2021-04-30 17:56:34 -04:00
|
|
|
),
|
2020-05-25 14:55:04 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test(tmp_path):
|
2021-05-03 11:45:43 -04:00
|
|
|
if utils.platform != "linux":
|
|
|
|
|
pytest.skip("the docker test is only relevant to the linux build")
|
2020-05-25 14:55:04 +02:00
|
|
|
|
2021-05-03 11:45:43 -04:00
|
|
|
project_dir = tmp_path / "project"
|
2020-05-25 14:55:04 +02:00
|
|
|
project_with_unicode.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
# build the wheels
|
2021-04-30 17:56:34 -04:00
|
|
|
actual_wheels = utils.cibuildwheel_run(
|
2021-05-03 11:45:43 -04:00
|
|
|
project_dir, add_env={"CIBW_TEST_COMMAND": 'python -c "import spam"'}
|
2021-04-30 17:56:34 -04:00
|
|
|
)
|
2020-05-25 14:55:04 +02:00
|
|
|
|
|
|
|
|
# check that the expected wheels are produced
|
2021-05-03 11:45:43 -04:00
|
|
|
expected_wheels = utils.expected_wheels("spam", "0.1.0")
|
2020-05-25 14:55:04 +02:00
|
|
|
assert set(actual_wheels) == set(expected_wheels)
|