mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	Adds /usr/lib/debug early to list, as some systems (debian) have unstripped libs in there Adds /lib/i386-linux-gnu for systems that does multiarch (debian) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153174 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			33 lines
		
	
	
		
			790 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			790 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import os.path
 | 
						|
import unittest
 | 
						|
 | 
						|
POSSIBLE_TEST_BINARIES = [
 | 
						|
    'libreadline.so.5',
 | 
						|
    'libreadline.so.6',
 | 
						|
]
 | 
						|
 | 
						|
POSSIBLE_TEST_BINARY_PATHS = [
 | 
						|
    '/usr/lib/debug',
 | 
						|
    '/lib',
 | 
						|
    '/usr/lib',
 | 
						|
    '/usr/local/lib',
 | 
						|
    '/lib/i386-linux-gnu',
 | 
						|
]
 | 
						|
 | 
						|
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!')
 | 
						|
    get_test_binary.__test__ = False
 |