6 POSSIBLE_TEST_BINARIES
= [
11 POSSIBLE_TEST_BINARY_PATHS
= [
16 '/lib/i386-linux-gnu',
19 class TestBase(unittest
.TestCase
):
20 if sys
.version_info
.major
== 2:
21 assertRaisesRegex
= unittest
.TestCase
.assertRaisesRegexp
23 def get_test_binary(self
):
24 """Helper to obtain a test binary for object file testing.
26 FIXME Support additional, highly-likely targets or create one
29 for d
in POSSIBLE_TEST_BINARY_PATHS
:
30 for lib
in POSSIBLE_TEST_BINARIES
:
31 path
= os
.path
.join(d
, lib
)
33 if os
.path
.exists(path
):
36 raise Exception('No suitable test binaries available!')
37 get_test_binary
.__test
__ = False
39 def get_test_file(self
):
40 return os
.path
.join(os
.path
.dirname(os
.path
.abspath(__file__
)), "test_file")
42 def get_test_bc(self
):
43 return os
.path
.join(os
.path
.dirname(os
.path
.abspath(__file__
)), "test.bc")