|
|
|
@ -191,26 +191,6 @@ class InternalTests(unittest.TestCase): |
|
|
|
|
l.append_direct('-lbar') |
|
|
|
|
self.assertEqual(l, ['-Lfoodir', '-lfoo', '-Lbardir', '-lbar', '-lbar']) |
|
|
|
|
|
|
|
|
|
def test_commonpath(self): |
|
|
|
|
from os.path import sep |
|
|
|
|
commonpath = mesonbuild.mesonlib.commonpath |
|
|
|
|
self.assertRaises(ValueError, commonpath, []) |
|
|
|
|
self.assertEqual(commonpath(['/usr', '/usr']), sep + 'usr') |
|
|
|
|
self.assertEqual(commonpath(['/usr', '/usr/']), sep + 'usr') |
|
|
|
|
self.assertEqual(commonpath(['/usr', '/usr/bin']), sep + 'usr') |
|
|
|
|
self.assertEqual(commonpath(['/usr/', '/usr/bin']), sep + 'usr') |
|
|
|
|
self.assertEqual(commonpath(['/usr/./', '/usr/bin']), sep + 'usr') |
|
|
|
|
self.assertEqual(commonpath(['/usr/bin', '/usr/bin']), sep + 'usr' + sep + 'bin') |
|
|
|
|
self.assertEqual(commonpath(['/usr//bin', '/usr/bin']), sep + 'usr' + sep + 'bin') |
|
|
|
|
self.assertEqual(commonpath(['/usr/./bin', '/usr/bin']), sep + 'usr' + sep + 'bin') |
|
|
|
|
self.assertEqual(commonpath(['/usr/local', '/usr/lib']), sep + 'usr') |
|
|
|
|
self.assertEqual(commonpath(['/usr', '/bin']), sep) |
|
|
|
|
self.assertEqual(commonpath(['/usr', 'bin']), '') |
|
|
|
|
self.assertEqual(commonpath(['blam', 'bin']), '') |
|
|
|
|
prefix = '/some/path/to/prefix' |
|
|
|
|
libdir = '/some/path/to/prefix/libdir' |
|
|
|
|
self.assertEqual(commonpath([prefix, libdir]), str(PurePath(prefix))) |
|
|
|
|
|
|
|
|
|
def test_string_templates_substitution(self): |
|
|
|
|
dictfunc = mesonbuild.mesonlib.get_filenames_templates_dict |
|
|
|
|
substfunc = mesonbuild.mesonlib.substitute_values |
|
|
|
|