Fix FullScreen crash in Webapp
[platform/framework/web/chromium-efl.git] / tools / find_runtime_symbols / PRESUBMIT.py
1 # Copyright 2012 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Top-level presubmit script for find_runtime_symbols.
6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details on the presubmit API built into depot_tools.
9 """
10
11 import sys
12
13
14 def CommonChecks(input_api, output_api):
15   def join(*args):
16     return input_api.os_path.join(input_api.PresubmitLocalPath(), *args)
17
18   output = []
19   sys_path_backup = sys.path
20   try:
21     sys.path = [
22       join('..', 'find_runtime_symbols'),
23     ] + sys.path
24     output.extend(
25         input_api.canned_checks.RunPylint(input_api, output_api, version='2.7'))
26   finally:
27     sys.path = sys_path_backup
28
29   output.extend(
30       input_api.canned_checks.RunUnitTestsInDirectory(
31           input_api,
32           output_api,
33           input_api.os_path.join(input_api.PresubmitLocalPath(), 'tests'),
34           files_to_check=[r'.+_test\.py$']))
35   return output
36
37
38 def CheckChangeOnUpload(input_api, output_api):
39   return CommonChecks(input_api, output_api)
40
41
42 def CheckChangeOnCommit(input_api, output_api):
43   return CommonChecks(input_api, output_api)