|
56 | 56 | cpp_test_project.files["setup.py"] = jinja2.Template(setup_py_template) |
57 | 57 | cpp_test_project.files["spam.cpp"] = jinja2.Template(spam_cpp_template) |
58 | 58 |
|
59 | | -cpp11_project = cpp_test_project.copy() |
60 | | -cpp11_project.template_context["extra_compile_args"] = ( |
61 | | - ["/std:c++11"] if utils.platform == "windows" else ["-std=c++11"] |
62 | | -) |
63 | | -cpp11_project.template_context["spam_cpp_top_level_add"] = "#include <array>" |
64 | | - |
65 | 59 |
|
66 | 60 | def test_cpp11(tmp_path): |
67 | 61 | # This test checks that the C++11 standard is supported |
68 | 62 | project_dir = tmp_path / "project" |
69 | | - |
| 63 | + cpp11_project = cpp_test_project.copy() |
| 64 | + cpp11_project.template_context["extra_compile_args"] = ( |
| 65 | + ["/std:c++11"] if utils.platform == "windows" else ["-std=c++11"] |
| 66 | + ) |
| 67 | + cpp11_project.template_context["spam_cpp_top_level_add"] = "#include <array>" |
70 | 68 | cpp11_project.generate(project_dir) |
71 | 69 |
|
72 | | - actual_wheels = utils.cibuildwheel_run(project_dir) |
73 | | - expected_wheels = list(utils.expected_wheels("spam", "0.1.0")) |
| 70 | + actual_wheels = utils.cibuildwheel_run(project_dir, single_python=True) |
| 71 | + expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True) |
74 | 72 |
|
75 | 73 | assert set(actual_wheels) == set(expected_wheels) |
76 | 74 |
|
77 | 75 |
|
78 | | -cpp14_project = cpp_test_project.copy() |
79 | | -cpp14_project.template_context["extra_compile_args"] = ( |
80 | | - ["/std:c++14"] if utils.platform == "windows" else ["-std=c++14"] |
81 | | -) |
82 | | -cpp14_project.template_context["spam_cpp_top_level_add"] = "int a = 100'000;" |
83 | | - |
84 | | - |
85 | 76 | def test_cpp14(tmp_path): |
86 | 77 | # This test checks that the C++14 standard is supported |
87 | 78 | project_dir = tmp_path / "project" |
88 | | - |
| 79 | + cpp14_project = cpp_test_project.copy() |
| 80 | + cpp14_project.template_context["extra_compile_args"] = ( |
| 81 | + ["/std:c++14"] if utils.platform == "windows" else ["-std=c++14"] |
| 82 | + ) |
| 83 | + cpp14_project.template_context["spam_cpp_top_level_add"] = "int a = 100'000;" |
89 | 84 | cpp14_project.generate(project_dir) |
90 | 85 |
|
91 | | - actual_wheels = utils.cibuildwheel_run(project_dir) |
92 | | - expected_wheels = list(utils.expected_wheels("spam", "0.1.0")) |
| 86 | + actual_wheels = utils.cibuildwheel_run(project_dir, single_python=True) |
| 87 | + expected_wheels = utils.expected_wheels("spam", "0.1.0", single_python=True) |
93 | 88 |
|
94 | 89 | assert set(actual_wheels) == set(expected_wheels) |
95 | 90 |
|
96 | 91 |
|
97 | | -cpp17_project = cpp_test_project.copy() |
98 | | - |
99 | | -cpp17_project.template_context["extra_compile_args"] = [ |
100 | | - "/std:c++17" if utils.platform == "windows" else "-std=c++17" |
101 | | -] |
102 | | -cpp17_project.template_context["spam_cpp_top_level_add"] = r""" |
103 | | -#include <utility> |
104 | | -auto a = std::pair(5.0, false); |
105 | | -""" |
106 | | - |
107 | | - |
108 | 92 | def test_cpp17(tmp_path): |
109 | 93 | # This test checks that the C++17 standard is supported |
110 | 94 | project_dir = tmp_path / "project" |
111 | | - |
| 95 | + cpp17_project = cpp_test_project.copy() |
| 96 | + cpp17_project.template_context["extra_compile_args"] = [ |
| 97 | + "/std:c++17" if utils.platform == "windows" else "-std=c++17" |
| 98 | + ] |
| 99 | + cpp17_project.template_context["spam_cpp_top_level_add"] = r""" |
| 100 | + #include <utility> |
| 101 | + auto a = std::pair(5.0, false); |
| 102 | + """ |
112 | 103 | cpp17_project.generate(project_dir) |
113 | 104 |
|
114 | 105 | if os.environ.get("APPVEYOR_BUILD_WORKER_IMAGE", "") == "Visual Studio 2015": |
115 | 106 | pytest.skip("Visual Studio 2015 does not support C++17") |
116 | 107 |
|
117 | | - # Pypy's distutils sets the default compiler to 'msvc9compiler', which |
118 | | - # is too old to support cpp17. |
119 | | - add_env = {"CIBW_SKIP": "pp*"} |
120 | | - |
| 108 | + add_env = {} |
121 | 109 | if utils.platform == "macos": |
122 | 110 | add_env["MACOSX_DEPLOYMENT_TARGET"] = "10.13" |
123 | 111 |
|
124 | | - actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env) |
125 | | - expected_wheels = [ |
126 | | - w |
127 | | - for w in utils.expected_wheels("spam", "0.1.0", macosx_deployment_target="10.13") |
128 | | - if "-pp" not in w |
129 | | - ] |
| 112 | + actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env, single_python=True) |
| 113 | + expected_wheels = utils.expected_wheels( |
| 114 | + "spam", "0.1.0", macosx_deployment_target="10.13", single_python=True |
| 115 | + ) |
130 | 116 |
|
131 | 117 | assert set(actual_wheels) == set(expected_wheels) |
0 commit comments