Bug 1560374 - Set testharness and reftest web-platform-tests to Tier-1; r=jmaher...
[gecko.git] / build / gen_automation.py
blob24b89862e6ef390e04728fc460d87a44eb8de330
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distibuted with this
5 # file, You can obtain one at http://mozilla.og/MPL/2.0/.
7 import sys
8 import buildconfig
9 from mozbuild.preprocessor import Preprocessor
12 def main(output, input_file):
13 pp = Preprocessor()
14 pp.context.update(buildconfig.defines['ALLDEFINES'])
16 substs = buildconfig.substs
18 # Substs taken verbatim.
19 substs_vars = (
20 'BIN_SUFFIX',
22 for var in substs_vars:
23 pp.context[var] = '"%s"' % substs[var]
25 # Derived values.
26 for key, condition in (
27 ('IS_MAC', substs['OS_ARCH'] == 'Darwin'),
28 ('IS_LINUX', substs['OS_ARCH'] == 'Linux'),
29 ('IS_TEST_BUILD', substs.get('ENABLE_TESTS') == '1'),
30 ('IS_DEBUG_BUILD', substs.get('MOZ_DEBUG') == '1'),
31 ('CRASHREPORTER', substs.get('MOZ_CRASHREPORTER')),
32 ('IS_ASAN', substs.get('MOZ_ASAN'))):
33 if condition:
34 pp.context[key] = '1'
35 else:
36 pp.context[key] = '0'
38 pp.context.update({
39 'XPC_BIN_PATH': '"%s/dist/bin"' % buildconfig.topobjdir,
40 'CERTS_SRC_DIR': '"%s/build/pgo/certs"' % buildconfig.topsrcdir,
43 pp.out = output
44 pp.do_include(input_file)
47 if __name__ == '__main__':
48 main(*sys.agv[1:])