aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-12-02 16:39:44 +0800
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-12-03 12:16:19 +0100
commited1bbcefeaafef460b6e5609de85e13c12e0d2a4 (patch)
tree04888e383dfa95aac1c91c308bd61362fdaf5b8f /contrib/devtools
parent5bab08df175db3a4283596515e498fc5a4d0dab9 (diff)
downloadbitcoin-ed1bbcefeaafef460b6e5609de85e13c12e0d2a4.tar.xz
contrib: add MACHO tests to symbol-check tests
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-xcontrib/devtools/test-symbol-check.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/devtools/test-symbol-check.py b/contrib/devtools/test-symbol-check.py
index 48abf60039..b07ec2ffdf 100755
--- a/contrib/devtools/test-symbol-check.py
+++ b/contrib/devtools/test-symbol-check.py
@@ -83,6 +83,43 @@ class TestSymbolChecks(unittest.TestCase):
self.assertEqual(call_symbol_check(cc, source, executable, ['-lm']),
(0, ''))
+ def test_MACHO(self):
+ source = 'test1.c'
+ executable = 'test1'
+ cc = 'clang'
+
+ with open(source, 'w', encoding="utf8") as f:
+ f.write('''
+ #include <expat.h>
+
+ int main()
+ {
+ XML_ExpatVersion();
+ return 0;
+ }
+
+ ''')
+
+ self.assertEqual(call_symbol_check(cc, source, executable, ['-lexpat']),
+ (1, 'libexpat.1.dylib is not in ALLOWED_LIBRARIES!\n' +
+ executable + ': failed DYNAMIC_LIBRARIES'))
+
+ source = 'test2.c'
+ executable = 'test2'
+ with open(source, 'w', encoding="utf8") as f:
+ f.write('''
+ #include <CoreGraphics/CoreGraphics.h>
+
+ int main()
+ {
+ CGMainDisplayID();
+ return 0;
+ }
+ ''')
+
+ self.assertEqual(call_symbol_check(cc, source, executable, ['-framework', 'CoreGraphics']),
+ (0, ''))
+
if __name__ == '__main__':
unittest.main()