mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 03:33:27 -03:00
contrib: add MACHO tests to symbol-check tests
This commit is contained in:
parent
5bab08df17
commit
ed1bbcefea
2 changed files with 38 additions and 0 deletions
|
@ -353,6 +353,7 @@ clean-local: clean-docs
|
||||||
test-security-check:
|
test-security-check:
|
||||||
if TARGET_DARWIN
|
if TARGET_DARWIN
|
||||||
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_MACHO
|
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_MACHO
|
||||||
|
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_MACHO
|
||||||
endif
|
endif
|
||||||
if TARGET_WINDOWS
|
if TARGET_WINDOWS
|
||||||
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_PE
|
$(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_PE
|
||||||
|
|
|
@ -83,6 +83,43 @@ class TestSymbolChecks(unittest.TestCase):
|
||||||
self.assertEqual(call_symbol_check(cc, source, executable, ['-lm']),
|
self.assertEqual(call_symbol_check(cc, source, executable, ['-lm']),
|
||||||
(0, ''))
|
(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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue