mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
[llvm.py] Implement interface to object files
It is now possible to load object files and scan over sections, symbols, and relocations! Includes test code with partial coverage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152482 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
29
bindings/python/llvm/tests/base.py
Normal file
29
bindings/python/llvm/tests/base.py
Normal file
@ -0,0 +1,29 @@
|
||||
import os.path
|
||||
import unittest
|
||||
|
||||
POSSIBLE_TEST_BINARIES = [
|
||||
'libreadline.so.5',
|
||||
'libreadline.so.6',
|
||||
]
|
||||
|
||||
POSSIBLE_TEST_BINARY_PATHS = [
|
||||
'/lib',
|
||||
'/usr/lib',
|
||||
'/usr/local/lib',
|
||||
]
|
||||
|
||||
class TestBase(unittest.TestCase):
|
||||
def get_test_binary(self):
|
||||
"""Helper to obtain a test binary for object file testing.
|
||||
|
||||
FIXME Support additional, highly-likely targets or create one
|
||||
ourselves.
|
||||
"""
|
||||
for d in POSSIBLE_TEST_BINARY_PATHS:
|
||||
for lib in POSSIBLE_TEST_BINARIES:
|
||||
path = os.path.join(d, lib)
|
||||
|
||||
if os.path.exists(path):
|
||||
return path
|
||||
|
||||
raise Exception('No suitable test binaries available!')
|
Reference in New Issue
Block a user