Backed out changeset 2912b402523d (bug 968245) for multiple test failures; CLOSED TREE

This commit is contained in:
Ed Morley 2014-02-25 17:05:52 +00:00
parent 5ebbbb4ebd
commit 42eca10dad
7 changed files with 12 additions and 37 deletions

View File

@ -9074,9 +9074,11 @@ ac_configure_args="$_SUBDIR_CONFIG_ARGS"
fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
export WRITE_MOZINFO=1
dnl we need to run config.status after js/src subconfigure because we're
dnl traversing its moz.build and we need its config.status for that.
dnl However, writing our own config.status needs to happen before
dnl subconfigures because the setup surrounding subconfigures alters
dnl many AC_SUBSTed variables.
MOZ_RUN_CONFIG_STATUS()
unset WRITE_MOZINFO

View File

@ -25,7 +25,7 @@ from ..frontend.data import (
XPIDLFile,
WebIDLFile,
)
from ..mozinfo import write_mozinfo
from ..util import DefaultOnReadDict
@ -172,8 +172,6 @@ class CommonBackend(BuildBackend):
self._webidls = WebIDLCollection()
self._configs = set()
self._write_mozinfo = True # For testing
def consume_object(self, obj):
self._configs.add(obj.config)
@ -239,13 +237,6 @@ class CommonBackend(BuildBackend):
for config in self._configs:
self.backend_input_files.add(config.source)
# Write out a JSON file used by test harnesses, other parts of
# automation.
if self._write_mozinfo and 'JS_STANDALONE' not in self.environment.substs:
path = mozpath.join(self.environment.topobjdir, 'mozinfo.json')
with self._write_file(path) as fh:
write_mozinfo(fh, self.environment, os.environ)
# Write out a machine-readable file describing every test.
path = mozpath.join(self.environment.topobjdir, 'all-tests.json')
with self._write_file(path) as fh:

View File

@ -20,6 +20,7 @@ from mozbuild.backend.recursivemake import RecursiveMakeBackend
from mozbuild.base import MachCommandConditions
from mozbuild.frontend.emitter import TreeMetadataEmitter
from mozbuild.frontend.reader import BuildReader
from mozbuild.mozinfo import write_mozinfo
log_manager = LoggingManager()
@ -106,6 +107,11 @@ def config_status(topobjdir='.', topsrcdir='.',
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
non_global_defines=non_global_defines, substs=substs, source=source)
# mozinfo.json only needs written if configure changes and configure always
# passes this environment variable.
if 'WRITE_MOZINFO' in os.environ:
write_mozinfo(os.path.join(topobjdir, 'mozinfo.json'), env, os.environ)
# Make an appropriate backend instance, defaulting to RecursiveMakeBackend.
backend_cls = RecursiveMakeBackend
if options.backend == 'AndroidEclipse':

View File

@ -98,9 +98,8 @@ def write_mozinfo(file, config, env=os.environ):
and what keys are produced.
"""
build_conf = build_dict(config, env)
args = {'indent': 2, 'sort_keys': True}
if isinstance(file, basestring):
with open(file, "w") as f:
json.dump(build_conf, f, **args)
json.dump(build_conf, f)
else:
json.dump(build_conf, file, **args)
json.dump(build_conf, file)

View File

@ -68,18 +68,6 @@ CONFIGS = DefaultOnReadDict({
('MOZ_APP_NAME', 'my_app'),
],
},
'mozinfo': {
'defines': [],
'non_global_defines': [],
'substs': [
('WRITE_MOZINFO', '1'),
# Some variables required for mozinfo generation.
('TARGET_CPU', 'dummy'),
('OS_TARGET', 'dummy'),
('MOZ_WIDGET_TOOLKIT', 'dummy'),
],
},
}, global_default={
'defines': [],
'non_global_defines': [],
@ -110,12 +98,9 @@ class BackendTester(unittest.TestCase):
return env, emitter.emit(reader.read_topsrcdir())
def _consume(self, name, cls, env=None, write_mozinfo=False):
def _consume(self, name, cls, env=None):
env, objs = self._emit(name, env=env)
backend = cls(env)
# Don't write mozinfo.json by default since it requires certain
# environment variables.
backend._write_mozinfo = write_mozinfo
backend.consume(objs)
return env

View File

@ -230,7 +230,6 @@ class TestRecursiveMakeBackend(BackendTester):
reader = BuildReader(env)
emitter = TreeMetadataEmitter(env)
backend = RecursiveMakeBackend(env)
backend._write_mozinfo = False
backend.consume(emitter.emit(reader.read_topsrcdir()))
self.assertEqual(os.path.getmtime(makefile_path), makefile_mtime)
@ -476,7 +475,6 @@ class TestRecursiveMakeBackend(BackendTester):
def test_install_manifests_written(self):
env, objs = self._emit('stub0')
backend = RecursiveMakeBackend(env)
backend._write_mozinfo = False
m = InstallManifest()
backend._install_manifests['testing'] = m
@ -675,12 +673,6 @@ class TestRecursiveMakeBackend(BackendTester):
stem = '%s/android_eclipse/%s' % (env.topobjdir, project_name)
self.assertIn(command_template % (stem, stem), lines)
def test_mozinfo(self):
env = self._consume('mozinfo', RecursiveMakeBackend, write_mozinfo=True)
self.assertTrue(os.path.exists(os.path.join(env.topobjdir,
'mozinfo.json')))
if __name__ == '__main__':
main()