author Emilio Cobos Álvarez <>
Fri, 16 Feb 2018 20:34:46 +0100
changeset 404634 a43a60bb3a90032950ff76cd6fb153562930c246
parent 346543 2324b5d27792b17e19afe42d70c224deb52565aa
child 468486 5cc56532ff4a4b2b896f84e4b6e7889837acb42d
permissions -rw-r--r--
Bug 1439027: Simplify PresShell::Initialize. r=bz Most of the callers pass the already-existing pres-context visible area. The few that don't can set it themselves. MozReview-Commit-ID: KRi4ShrgOrE

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

import sys

from mozbuild.backend.test_manifest import TestManifestBackend
from mozbuild.base import BuildEnvironmentNotFoundException, MozbuildObject
from mozbuild.frontend.emitter import TreeMetadataEmitter
from mozbuild.frontend.reader import BuildReader, EmptyConfig

def gen_test_backend():
    build_obj = MozbuildObject.from_environment()
        config = build_obj.config_environment
    except BuildEnvironmentNotFoundException:
        print("No build detected, test metadata may be incomplete.")

        # If 'JS_STANDALONE' is set, tests that don't require an objdir won't
        # be picked up due to bug 1345209.
        substs = EmptyConfig.default_substs
        if 'JS_STANDALONE' in substs:
            del substs['JS_STANDALONE']

        config = EmptyConfig(build_obj.topsrcdir, substs)
        config.topobjdir = build_obj.topobjdir

    reader = BuildReader(config)
    emitter = TreeMetadataEmitter(config)
    backend = TestManifestBackend(config)

    context = reader.read_topsrcdir()
    data = emitter.emit(context, emitfn=emitter._process_test_manifests)

if __name__ == '__main__':