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 6"""//testing/scripts wrapper for the grit unittests. This script is used to run 7test_suite_all.py on the trybots to ensure that grit is working correctly on 8all platforms.""" 9 10import json 11import os 12import sys 13 14# Add src/testing/ into sys.path for importing common without pylint errors. 15sys.path.append( 16 os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) 17from scripts import common 18 19 20def main_run(args): 21 rc = common.run_command([ 22 sys.executable, 23 os.path.join(common.SRC_DIR, 'tools', 'grit', 'grit', 24 'test_suite_all.py'), 25 ]) 26 27 json.dump({ 28 'valid': True, 29 'failures': ['Please refer to stdout for errors.'] if rc else [], 30 }, args.output) 31 32 return rc 33 34 35def main_compile_targets(args): 36 json.dump([], args.output) 37 38 39if __name__ == '__main__': 40 funcs = { 41 'run': main_run, 42 'compile_targets': main_compile_targets, 43 } 44 sys.exit(common.run_script(sys.argv[1:], funcs)) 45