Skip to content

Commit adf2d3e

Browse files
committed
Add unit test for cmake list settings
1 parent bad9831 commit adf2d3e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_skbuild_settings.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,3 +754,19 @@ def test_skbuild_settings_auto_cmake_warning(
754754
Report this or (and) set manually to avoid this warning. Using 3.15 as a fall-back.
755755
""".split()
756756
)
757+
758+
759+
def test_skbuild_settings_cmake_define_list():
760+
pyproject_toml = (
761+
Path(__file__).parent / "packages" / "cmake_defines" / "pyproject.toml"
762+
)
763+
764+
config_settings: dict[str, list[str] | str] = {}
765+
766+
settings_reader = SettingsReader.from_file(pyproject_toml, config_settings)
767+
settings = settings_reader.settings
768+
769+
assert settings.cmake.define == {
770+
"NESTED_LIST": r"Apple;Lemon\;Lime;Banana",
771+
"ONE_LEVEL_LIST": "Foo;Bar;ExceptionallyLargeListEntryThatWouldOverflowTheLine;Baz",
772+
}

0 commit comments

Comments
 (0)