Bug 901644 - Allow mach build paths to be specified relative to ; r=gps

--HG--
extra : rebase_source : 529399abba46287f038b679d8db970791ed113f2
This commit is contained in:
Dave Camp 2013-08-07 14:31:25 -07:00
parent 4e12e5ed5c
commit b32cfee08a
2 changed files with 6 additions and 8 deletions

View File

@ -121,9 +121,11 @@ class TestResolveTargetToMake(unittest.TestCase):
target = target.replace(os.sep, '/')
self.assertEqual((reldir, target), expected)
def test_absolute_path(self):
abspath = os.path.abspath(os.path.join(self.topobjdir, 'test-dir'))
self.assertResolve(abspath, (None, None))
def test_root_path(self):
self.assertResolve('/test-dir', ('test-dir', None))
self.assertResolve('/test-dir/with', ('test-dir/with', None))
self.assertResolve('/test-dir/without', ('test-dir', None))
self.assertResolve('/test-dir/without/with', ('test-dir/without/with', None))
def test_dir(self):
self.assertResolve('test-dir', ('test-dir', None))

View File

@ -175,12 +175,8 @@ def resolve_target_to_make(topobjdir, target):
Makefile containing a different Makefile, and an appropriate
target.
'''
if os.path.isabs(target):
print('Absolute paths for make targets are not allowed.')
return (None, None)
target = target.replace(os.sep, '/')
target = target.replace(os.sep, '/').lstrip('/')
abs_target = os.path.join(topobjdir, target)
# For directories, run |make -C dir|. If the directory does not