-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #52062 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
- Loading branch information
1 parent
48cbd5f
commit 5f1e7a0
Showing
8 changed files
with
79 additions
and
159 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python3 | ||
|
||
"""Unit tests for the xcode_emulation.py file.""" | ||
|
||
from gyp.xcode_emulation import XcodeSettings | ||
import sys | ||
import unittest | ||
|
||
|
||
class TestXcodeSettings(unittest.TestCase): | ||
def setUp(self): | ||
if sys.platform != "darwin": | ||
self.skipTest("This test only runs on macOS") | ||
|
||
def test_GetCflags(self): | ||
target = { | ||
"type": "static_library", | ||
"configurations": { | ||
"Release": {}, | ||
}, | ||
} | ||
configuration_name = "Release" | ||
xcode_settings = XcodeSettings(target) | ||
cflags = xcode_settings.GetCflags(configuration_name, "arm64") | ||
|
||
# Do not quote `-arch arm64` with spaces in one string. | ||
self.assertEqual( | ||
cflags, | ||
["-fasm-blocks", "-mpascal-strings", "-Os", "-gdwarf-2", "-arch", "arm64"], | ||
) | ||
|
||
def GypToBuildPath(self, path): | ||
return path | ||
|
||
def test_GetLdflags(self): | ||
target = { | ||
"type": "static_library", | ||
"configurations": { | ||
"Release": {}, | ||
}, | ||
} | ||
configuration_name = "Release" | ||
xcode_settings = XcodeSettings(target) | ||
ldflags = xcode_settings.GetLdflags( | ||
configuration_name, "PRODUCT_DIR", self.GypToBuildPath, "arm64" | ||
) | ||
|
||
# Do not quote `-arch arm64` with spaces in one string. | ||
self.assertEqual(ldflags, ["-arch", "arm64", "-LPRODUCT_DIR"]) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters