2012-03-10 04:41:24 +00:00
|
|
|
import os.path
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
POSSIBLE_TEST_BINARIES = [
|
|
|
|
'libreadline.so.5',
|
|
|
|
'libreadline.so.6',
|
|
|
|
]
|
|
|
|
|
|
|
|
POSSIBLE_TEST_BINARY_PATHS = [
|
2012-03-21 08:34:58 +00:00
|
|
|
'/usr/lib/debug',
|
2012-03-10 04:41:24 +00:00
|
|
|
'/lib',
|
|
|
|
'/usr/lib',
|
|
|
|
'/usr/local/lib',
|
2012-03-21 08:34:58 +00:00
|
|
|
'/lib/i386-linux-gnu',
|
2012-03-10 04:41:24 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
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!')
|
2012-03-21 08:18:19 +00:00
|
|
|
get_test_binary.__test__ = False
|