Jack Neus | e130b5a | 2019-07-02 15:33:56 -0600 | [diff] [blame] | 1 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | def CheckGolangRunTests(input_api, output_api): |
| 6 | try: |
| 7 | test_output = input_api.subprocess.check_output(['./run_tests.sh']) |
| 8 | except Exception as error: |
| 9 | return [ |
| 10 | output_api.PresubmitError( |
| 11 | 'run_tests.sh failed.\noutput:%s\n' % error.output) |
| 12 | ] |
| 13 | return [] |
| 14 | |
| 15 | |
| 16 | def CommonChecks(input_api, output_api): |
| 17 | results = [] |
| 18 | |
| 19 | # ./run_tests.sh |
| 20 | results.extend(CheckGolangRunTests(input_api, output_api)) |
| 21 | |
| 22 | return results |
| 23 | |
| 24 | |
| 25 | #TODO verbose flag |
| 26 | CheckChangeOnUpload = CommonChecks |
| 27 | CheckChangeOnCommit = CommonChecks |