Reapplied changeset 31ff9550fba6 (bug 870073)

This commit is contained in:
Matt Brubeck 2013-05-10 15:49:57 -07:00
parent d831a0faa5
commit 430083b7bf
2 changed files with 8 additions and 1 deletions

View File

@ -175,12 +175,16 @@ class TestWriteJson(unittest.TestCase):
"""
write_json(self.f, env={'OS_TARGET':'WINNT',
'TARGET_CPU':'i386',
'TOPSRCDIR':'/tmp',
'MOZCONFIG':'foo',
'MOZ_WIDGET_TOOLKIT':'windows'})
with open(self.f) as f:
d = json.load(f)
self.assertEqual('win', d['os'])
self.assertEqual('x86', d['processor'])
self.assertEqual('windows', d['toolkit'])
self.assertEqual('/tmp', d['topsrcdir'])
self.assertEqual(os.path.normpath('/tmp/foo'), d['mozconfig'])
self.assertEqual(32, d['bits'])
def testFileObj(self):

View File

@ -30,7 +30,10 @@ def build_dict(env=os.environ):
', '.join(missing))
if 'MOZCONFIG' in env:
d["mozconfig"] = env["MOZCONFIG"]
mozconfig = env["MOZCONFIG"]
if 'TOPSRCDIR' in env:
mozconfig = os.path.join(env["TOPSRCDIR"], mozconfig)
d['mozconfig'] = os.path.normpath(mozconfig)
if 'TOPSRCDIR' in env:
d["topsrcdir"] = env["TOPSRCDIR"]