|
6 | 6 | import utils |
7 | 7 |
|
8 | 8 |
|
| 9 | +project_dir = os.path.dirname(__file__) |
| 10 | + |
9 | 11 | def test_cpp11(tmp_path): |
10 | | - add_env = {"CIBW_SKIP": "cp27-win*", "CIBW_ENVIRONMENT": "STANDARD=11"} |
11 | | - # VC for python 2.7 do not support modern standards |
12 | | - if utils.platform == "macos": |
13 | | - add_env["MACOSX_DEPLOYMENT_TARGET"] = "10.9" |
14 | | - project_dir = os.path.dirname(__file__) |
15 | | - # this test checks if c++11 standard is supported. |
| 12 | + # This test checks that the C++11 standard is supported |
| 13 | + |
| 14 | + add_env = {'CIBW_SKIP': 'cp27-win*', 'CIBW_ENVIRONMENT': 'STANDARD=11'} |
| 15 | + # VC++ for Python 2.7 does not support modern standards |
| 16 | + if utils.platform == 'macos': |
| 17 | + add_env['MACOSX_DEPLOYMENT_TARGET'] = '10.9' |
16 | 18 |
|
17 | 19 | actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env) |
18 | | - expected_wheels = [x for x in utils.expected_wheels('spam', '0.1.0', |
19 | | - macosx_deployment_target="10.9") if "cp27-cp27m-win" not in x] |
| 20 | + expected_wheels = [x for x in utils.expected_wheels( |
| 21 | + 'spam', '0.1.0', macosx_deployment_target='10.9') |
| 22 | + if 'cp27-cp27m-win' not in x] |
20 | 23 | assert set(actual_wheels) == set(expected_wheels) |
21 | 24 |
|
22 | 25 |
|
23 | 26 | def test_cpp14(): |
24 | | - add_env = {"CIBW_SKIP": "cp27-win* cp35-win*", "CIBW_ENVIRONMENT": "STANDARD=14"} |
25 | | - # VC for python 2.7 do not support modern standards |
26 | | - # manylinux1 docker image do not support compilers with standards newer than c++11 |
27 | | - # python 3.4 and 3.5 are compiled with MSVC 10. which not support c++14 |
28 | | - if utils.platform == "macos": |
29 | | - add_env["MACOSX_DEPLOYMENT_TARGET"] = "10.9" |
30 | | - project_dir = os.path.dirname(__file__) |
31 | | - # this test checks if c++14 standard is supported. |
| 27 | + # This test checks that the C++14 standard is supported |
| 28 | + |
| 29 | + add_env = {'CIBW_SKIP': 'cp27-win* cp35-win*', 'CIBW_ENVIRONMENT': 'STANDARD=14'} |
| 30 | + # VC++ for Python 2.7 does not support modern standards |
| 31 | + # The manylinux1 docker image does not have a compiler which supports C++11 |
| 32 | + # Python 3.4 and 3.5 are compiled with MSVC 10, which does not support C++14 |
| 33 | + if utils.platform == 'macos': |
| 34 | + add_env['MACOSX_DEPLOYMENT_TARGET'] = '10.9' |
32 | 35 |
|
33 | 36 | actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env) |
34 | 37 | expected_wheels = [x for x in utils.expected_wheels( |
35 | | - 'spam', '0.1.0', macosx_deployment_target="10.9") |
36 | | - if "cp27-cp27m-win" not in x and "cp35-cp35m-win" not in x] |
| 38 | + 'spam', '0.1.0', macosx_deployment_target='10.9') |
| 39 | + if 'cp27-cp27m-win' not in x and 'cp35-cp35m-win' not in x] |
37 | 40 | assert set(actual_wheels) == set(expected_wheels) |
38 | 41 |
|
| 42 | + |
39 | 43 | def test_cpp17(): |
40 | | - # python 2.7 use `register` keyword which is forbidden in c++17 standard |
41 | | - # manylinux1 docker image do not support compilers with standards newer than c++11 |
42 | | - # python 3.4 and 3.5 are compiled with MSVC 10. which not support c++17 |
43 | | - if os.environ.get("APPVEYOR_BUILD_WORKER_IMAGE", "") == "Visual Studio 2015": |
44 | | - pytest.skip("Visual Studio 2015 does not support c++17") |
| 44 | + # This test checks that the C++17 standard is supported |
45 | 45 |
|
46 | | - add_env = {"CIBW_SKIP": "cp27-win* cp35-win*", "CIBW_ENVIRONMENT": "STANDARD=17"} |
47 | | - if utils.platform == "macos": |
48 | | - add_env["MACOSX_DEPLOYMENT_TARGET"] = "10.13" |
| 46 | + # Python 2.7 uses the `register` keyword which is forbidden in the C++17 standard |
| 47 | + # The manylinux1 docker image does not have a compiler which supports C++11 |
| 48 | + # Python 3.4 and 3.5 are compiled with MSVC 10, which does not support C++17 |
| 49 | + if os.environ.get('APPVEYOR_BUILD_WORKER_IMAGE', '') == 'Visual Studio 2015': |
| 50 | + pytest.skip('Visual Studio 2015 does not support C++17') |
49 | 51 |
|
50 | | - project_dir = os.path.dirname(__file__) |
51 | | - # this test checks if c++17 standard is supported. |
| 52 | + add_env = {'CIBW_SKIP': 'cp27-win* cp35-win*', 'CIBW_ENVIRONMENT': 'STANDARD=17'} |
| 53 | + if utils.platform == 'macos': |
| 54 | + add_env['MACOSX_DEPLOYMENT_TARGET'] = '10.13' |
52 | 55 |
|
53 | 56 | actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env) |
54 | | - expected_wheels = [x for x in utils.expected_wheels('spam', '0.1.0', |
55 | | - macosx_deployment_target="10.13") |
56 | | - if "cp27-cp27m-win" not in x and "cp35-cp35m-win" not in x] |
| 57 | + expected_wheels = [x for x in utils.expected_wheels( |
| 58 | + 'spam', '0.1.0', macosx_deployment_target='10.13') |
| 59 | + if 'cp27-cp27m-win' not in x and 'cp35-cp35m-win' not in x] |
57 | 60 | assert set(actual_wheels) == set(expected_wheels) |
58 | | - |
|
0 commit comments