Bug 878043 - allow get_binary_path to return a path for any binary. r=glandium

This commit is contained in:
Ted Mielczarek 2013-05-30 08:37:37 -04:00
Родитель 4b21d3fcfc
Коммит 1c90df8a68
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -272,13 +272,7 @@ class MozbuildObject(ProcessExecutionMixin):
leaf = None
if what == 'app':
leaf = substs['MOZ_APP_NAME'] + substs['BIN_SUFFIX']
elif what == 'xpcshell':
leaf = 'xpcshell'
else:
raise Exception("Don't know how to locate binary: %s" % what)
leaf = (substs['MOZ_APP_NAME'] if what == 'app' else what) + substs['BIN_SUFFIX']
path = os.path.join(stem, leaf)
if validate_exists and not os.path.exists(path):

Просмотреть файл

@ -118,6 +118,12 @@ class TestMozbuildObject(unittest.TestCase):
self.assertRaises(Exception, base.get_binary_path, where="somewhere")
p = base.get_binary_path('foobar', validate_exists=False)
if platform.startswith('win32'):
self.assertTrue(p.endswith('foobar.exe'))
else:
self.assertTrue(p.endswith('foobar'))
class TestPathArgument(unittest.TestCase):
def test_path_argument(self):
# Absolute path