|
11 | 11 | from pathlib import Path |
12 | 12 | from tomllib import loads |
13 | 13 |
|
| 14 | +import pytest |
14 | 15 | from typer.testing import CliRunner |
15 | 16 |
|
16 | 17 | from cppython.build import build_wheel |
|
20 | 21 |
|
21 | 22 | pytest_plugins = ['tests.fixtures.example', 'tests.fixtures.conan', 'tests.fixtures.cmake'] |
22 | 23 |
|
| 24 | +# C++20 modules require Ninja or Visual Studio generator, not Unix Makefiles |
| 25 | +_skip_modules_test = pytest.mark.skipif( |
| 26 | + sys.platform != 'win32', reason='C++20 modules require Ninja or Visual Studio generator, not Unix Makefiles.' |
| 27 | +) |
| 28 | + |
23 | 29 |
|
24 | 30 | class TestConanCMake: |
25 | 31 | """Test project variation of conan and CMake""" |
@@ -47,7 +53,7 @@ def _run_cmake_configure(cmake_binary: str) -> None: |
47 | 53 | Args: |
48 | 54 | cmake_binary: Path or command name for the CMake binary to use |
49 | 55 | """ |
50 | | - result = subprocess.run([cmake_binary, '--preset=default'], capture_output=True, text=True, check=False) |
| 56 | + result = subprocess.run([cmake_binary, '--preset=default-release'], capture_output=True, text=True, check=False) |
51 | 57 | assert result.returncode == 0, f'CMake configuration failed: {result.stderr}' |
52 | 58 |
|
53 | 59 | @staticmethod |
@@ -108,6 +114,7 @@ def test_simple(example_runner: CliRunner) -> None: |
108 | 114 | publish_project.publish() |
109 | 115 |
|
110 | 116 | @staticmethod |
| 117 | + @_skip_modules_test |
111 | 118 | def test_library(example_runner: CliRunner) -> None: |
112 | 119 | """Test library creation and packaging workflow""" |
113 | 120 | # Read cmake_binary from the current pyproject.toml (we're in the example directory) |
|
0 commit comments