Bug 1041839 - Write all-tests.json faster. r=gps

This commit is contained in:
Mike Hommey 2014-07-23 13:32:03 +09:00
parent e7c51b334d
commit 66aeea108c
2 changed files with 4 additions and 3 deletions

View File

@ -240,8 +240,8 @@ class CommonBackend(BuildBackend):
# 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:
json.dump(self._test_manager.tests_by_path, fh, sort_keys=True,
indent=2)
s = json.dumps(self._test_manager.tests_by_path)
fh.write(s)
def _create_config_header(self, obj):
'''Creates the given config header. A config header is generated by

View File

@ -10,6 +10,7 @@ import os
import mozpack.path as mozpath
from .base import MozbuildObject
from .util import OrderedDefaultDict
from collections import defaultdict
@ -44,7 +45,7 @@ class TestMetadata(object):
"""
def __init__(self, filename=None):
self._tests_by_path = defaultdict(list)
self._tests_by_path = OrderedDefaultDict(list)
self._tests_by_flavor = defaultdict(set)
self._test_dirs = set()