1#!/usr/bin/env python 2# Copyright 2019 The Chromium Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5"""//testing/scripts wrapper for the grit unittests. This script is used to run 6test_suite_all.py on the trybots to ensure that grit is working correctly on 7all platforms.""" 8 9import json 10import os 11import sys 12 13import common 14 15 16def main_run(args): 17 rc = common.run_command([ 18 sys.executable, 19 os.path.join(common.SRC_DIR, 'tools', 'grit', 'grit', 20 'test_suite_all.py'), 21 ]) 22 23 json.dump( 24 { 25 'valid': True, 26 'failures': ['Please refer to stdout for errors.'] if rc else [], 27 }, args.output) 28 29 return rc 30 31 32def main_compile_targets(args): 33 json.dump([], args.output) 34 35 36if __name__ == '__main__': 37 funcs = { 38 'run': main_run, 39 'compile_targets': main_compile_targets, 40 } 41 sys.exit(common.run_script(sys.argv[1:], funcs)) 42