Skip to content

Commit

Permalink
Add unit test for cmake list settings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreinking committed Oct 2, 2024
1 parent bad9831 commit adf2d3e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_skbuild_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,3 +754,19 @@ def test_skbuild_settings_auto_cmake_warning(
Report this or (and) set manually to avoid this warning. Using 3.15 as a fall-back.
""".split()
)


def test_skbuild_settings_cmake_define_list():
pyproject_toml = (
Path(__file__).parent / "packages" / "cmake_defines" / "pyproject.toml"
)

config_settings: dict[str, list[str] | str] = {}

settings_reader = SettingsReader.from_file(pyproject_toml, config_settings)
settings = settings_reader.settings

assert settings.cmake.define == {
"NESTED_LIST": r"Apple;Lemon\;Lime;Banana",
"ONE_LEVEL_LIST": "Foo;Bar;ExceptionallyLargeListEntryThatWouldOverflowTheLine;Baz",
}

0 comments on commit adf2d3e

Please sign in to comment.