Bug 976733 - part 1a - add test for EXTRA_JS{_PP,}_MODULES output; r=mshal

This commit is contained in:
Nathan Froyd 2014-09-15 13:31:25 -04:00
parent ef62a1db88
commit 0ce8a6bf9c
3 changed files with 40 additions and 2 deletions

View File

@ -907,7 +907,8 @@ class RecursiveMakeBackend(CommonBackend):
prefix = 'extra_js_%s' % path.replace('/', '_')
backend_file.write('%s_FILES := %s\n'
% (prefix, ' '.join(strings)))
backend_file.write('%s_DEST = $(FINAL_TARGET)/modules/%s\n' % (prefix, path))
backend_file.write('%s_DEST = %s\n' %
(prefix, mozpath.join('$(FINAL_TARGET)', 'modules', path)))
backend_file.write('INSTALL_TARGETS += %s\n\n' % prefix)
return
@ -919,7 +920,8 @@ class RecursiveMakeBackend(CommonBackend):
prefix = 'extra_pp_js_%s' % path.replace('/', '_')
backend_file.write('%s := %s\n'
% (prefix, ' '.join(strings)))
backend_file.write('%s_PATH = $(FINAL_TARGET)/modules/%s\n' % (prefix, path))
backend_file.write('%s_PATH = %s\n' %
(prefix, mozpath.join('$(FINAL_TARGET)', 'modules', path)))
backend_file.write('PP_TARGETS += %s\n\n' % prefix)
return

View File

@ -0,0 +1,8 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
EXTRA_JS_MODULES += ['module1.js', 'module2.js']
EXTRA_JS_MODULES.submodule += ['module3.js', 'module4.js']
EXTRA_PP_JS_MODULES += ['pp-module1.js']
EXTRA_PP_JS_MODULES.ppsub += ['pp-module2.js']

View File

@ -617,6 +617,34 @@ class TestRecursiveMakeBackend(BackendTester):
self.assertIn('JAR_MANIFEST := %s/jar.mn' % env.topsrcdir, lines)
def test_extra_js_modules(self):
env = self._consume('extra-js-modules', RecursiveMakeBackend)
with open(os.path.join(env.topobjdir, 'backend.mk'), 'rb') as fh:
lines = fh.readlines()
lines = [line.rstrip() for line in lines]
self.maxDiff = None
expected = [
'extra_js__FILES := module1.js module2.js',
'extra_js__DEST = $(FINAL_TARGET)/modules/',
'INSTALL_TARGETS += extra_js_',
'extra_js_submodule_FILES := module3.js module4.js',
'extra_js_submodule_DEST = $(FINAL_TARGET)/modules/submodule',
'INSTALL_TARGETS += extra_js_submodule',
'extra_pp_js_ := pp-module1.js',
'extra_pp_js__PATH = $(FINAL_TARGET)/modules/',
'PP_TARGETS += extra_pp_js_',
'extra_pp_js_ppsub := pp-module2.js',
'extra_pp_js_ppsub_PATH = $(FINAL_TARGET)/modules/ppsub',
'PP_TARGETS += extra_pp_js_ppsub',
]
found = [line for line in lines if line.startswith(('extra_',
'INSTALL_TARGETS',
'PP_TARGETS'))]
self.assertEqual(expected, found)
def test_test_manifests_duplicate_support_files(self):
"""Ensure duplicate support-files in test manifests work."""
env = self._consume('test-manifests-duplicate-support-files',