mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 902389 - Normalize topobjdir; r=mshal
This commit is contained in:
parent
0a4275cc10
commit
2be348ac4c
@ -176,8 +176,9 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
topobj = self.mozconfig['topobjdir'] or 'obj-@CONFIG_GUESS@'
|
||||
if not os.path.isabs(topobj):
|
||||
topobj = os.path.abspath(os.path.join(self.topsrcdir, topobj))
|
||||
self._topobjdir = topobj.replace("@CONFIG_GUESS@",
|
||||
self._config_guess)
|
||||
topobj = topobj.replace("@CONFIG_GUESS@", self._config_guess)
|
||||
self._topobjdir = os.path.normpath(topobj)
|
||||
|
||||
return self._topobjdir
|
||||
|
||||
@property
|
||||
|
@ -47,6 +47,21 @@ class TestMozbuildObject(unittest.TestCase):
|
||||
|
||||
del os.environ[b'MOZCONFIG']
|
||||
|
||||
def test_objdir_trailing_slash(self):
|
||||
"""Trailing slashes in topobjdir should be removed."""
|
||||
base = self.get_base()
|
||||
|
||||
with NamedTemporaryFile() as mozconfig:
|
||||
mozconfig.write('mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/foo/')
|
||||
mozconfig.flush()
|
||||
os.environ[b'MOZCONFIG'] = mozconfig.name
|
||||
|
||||
self.assertEqual(base.topobjdir, os.path.join(base.topsrcdir,
|
||||
'foo'))
|
||||
self.assertTrue(base.topobjdir.endswith('foo'))
|
||||
|
||||
del os.environ[b'MOZCONFIG']
|
||||
|
||||
def test_config_guess(self):
|
||||
# It's difficult to test for exact values from the output of
|
||||
# config.guess because they vary depending on platform.
|
||||
|
Loading…
Reference in New Issue
Block a user