• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import py, sys, os
2import _cffi_backend
3
4def test_no_unknown_exported_symbols():
5    if not hasattr(_cffi_backend, '__file__'):
6        py.test.skip("_cffi_backend module is built-in")
7    if not sys.platform.startswith('linux'):
8        py.test.skip("linux-only")
9    g = os.popen("objdump -T '%s'" % _cffi_backend.__file__, 'r')
10    for line in g:
11        if not line.startswith('0'):
12            continue
13        if '*UND*' in line:
14            continue
15        name = line.split()[-1]
16        if name.startswith('_') or name.startswith('.'):
17            continue
18        if name not in ('init_cffi_backend', 'PyInit__cffi_backend'):
19            raise Exception("Unexpected exported name %r" % (name,))
20    g.close()
21