blob: d364f862f25415929783646dd224477de4f8bc84 [file] [log] [blame]
kjellander@webrtc.org861dcb72016-02-24 21:36:40 +01001# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9
10def _CommonChecks(input_api, output_api):
11 results = []
12
13 # Validate the format of the mb_config.pyl file.
14 mb_script = input_api.os_path.join(input_api.PresubmitLocalPath(), '..',
15 '..', 'tools', 'mb', 'mb.py')
16 mb_config_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
17 'mb_config.pyl')
18 cmd = [input_api.python_executable, mb_script, 'validate', '--config-file',
19 mb_config_path]
20 kwargs = {'cwd': input_api.PresubmitLocalPath()}
21 results.extend(input_api.RunTests([
22 input_api.Command(name='mb_validate',
23 cmd=cmd, kwargs=kwargs,
24 message=output_api.PresubmitError)]))
25
26 return results
27
28
29def CheckChangeOnUpload(input_api, output_api):
30 return _CommonChecks(input_api, output_api)
31
32
33def CheckChangeOnCommit(input_api, output_api):
34 return _CommonChecks(input_api, output_api)