Skip to content

Commit 7f92ced

Browse files
committed
fixup!
1 parent bb166cf commit 7f92ced

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

pylib/gyp/xcode_emulation_test.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python3
2+
3+
"""Unit tests for the xcode_emulation.py file."""
4+
5+
from gyp.xcode_emulation import XcodeSettings
6+
import unittest
7+
8+
9+
class TestXcodeSettings(unittest.TestCase):
10+
def test_GetCflags(self):
11+
target = {
12+
"type": "static_library",
13+
"configurations": {
14+
"Release": {},
15+
},
16+
}
17+
configuration_name = "Release"
18+
xcode_settings = XcodeSettings(target)
19+
cflags = xcode_settings.GetCflags(configuration_name, "arm64")
20+
21+
# Do not quote `-arch arm64` with spaces in one string.
22+
self.assertEqual(
23+
cflags,
24+
["-fasm-blocks", "-mpascal-strings", "-Os", "-gdwarf-2", "-arch", "arm64"],
25+
)
26+
27+
def GypToBuildPath(self, path):
28+
return path
29+
30+
def test_GetLdflags(self):
31+
target = {
32+
"type": "static_library",
33+
"configurations": {
34+
"Release": {},
35+
},
36+
}
37+
configuration_name = "Release"
38+
xcode_settings = XcodeSettings(target)
39+
ldflags = xcode_settings.GetLdflags(
40+
configuration_name, "PRODUCT_DIR", self.GypToBuildPath, "arm64"
41+
)
42+
43+
# Do not quote `-arch arm64` with spaces in one string.
44+
self.assertEqual(ldflags, ["-arch", "arm64", "-LPRODUCT_DIR"])
45+
46+
47+
if __name__ == "__main__":
48+
unittest.main()

0 commit comments

Comments
 (0)