chromium-src-build/android/PRESUBMIT.py

77 строки
2.3 KiB
Python
Исходник Обычный вид История

# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for android buildbot.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built into depot_tools.
"""
def CommonChecks(input_api, output_api):
output = []
build_android_dir = input_api.PresubmitLocalPath()
def J(*dirs):
"""Returns a path relative to presubmit directory."""
return input_api.os_path.join(build_android_dir, *dirs)
build_pys = [
r'gyp/.*\.py$',
r'gn/.*\.py',
]
output.extend(input_api.canned_checks.RunPylint(
input_api,
output_api,
pylintrc='pylintrc',
black_list=build_pys,
extra_paths_list=[
J(),
J('gyp'),
J('buildbot'),
J('..', '..', 'third_party', 'catapult', 'devil')
]))
output.extend(input_api.canned_checks.RunPylint(
input_api,
output_api,
white_list=build_pys,
extra_paths_list=[J('gyp'), J('gn')]))
# Disabled due to http://crbug.com/410936
#output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
#input_api, output_api, J('buildbot', 'tests')))
pylib_test_env = dict(input_api.environ)
pylib_test_env.update({
'PYTHONPATH': build_android_dir,
'PYTHONDONTWRITEBYTECODE': '1',
})
output.extend(input_api.canned_checks.RunUnitTests(
input_api,
output_api,
unit_tests=[
J('.', 'emma_coverage_stats_test.py'),
Reland of CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp (patchset #1 id:1 of https://codereview.chromium.org/1369583002/ ) Reason for revert: Fixed import path and ensured "ninja all" builds locally. Original issue's description: > Revert of CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp (patchset #4 id:60001 of https://codereview.chromium.org/1356873003/ ) > > Reason for revert: > broke Android build (see other messages for details). > > Original issue's description: > > CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp > > > > Added output_paths to md5_check.py since it cuts down on > > force=os.path.exists() boilder-plate (plus places that were forgetting > > it). It also improves the message printed when PRINT_MD5_DIFFS=1 is set. > > > > Added a wrapper in build_utils.py that automatically handles --depfile > > and --stamp options, which further cuts down on boilerplate in the > > clients. > > > > Removed colorama to eliminate circular dependency between build_utils > > and md5_check. > > > > BUG=533442 > > > > Committed: https://crrev.com/dea0f30983bc18874ac8c49443fb5079d4c1b798 > > Cr-Commit-Position: refs/heads/master@{#350599} > > TBR=jbudorick@chromium.org,stgao@chromium.org,agrieve@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=533442 > > Committed: https://crrev.com/1748d384c547136d059d413f5acbb1622ba548f0 > Cr-Commit-Position: refs/heads/master@{#350626} TBR=jbudorick@chromium.org,stgao@chromium.org,caitkp@chromium.org NOTRY=true BUG=533442 Review URL: https://codereview.chromium.org/1369593002 Cr-Original-Commit-Position: refs/heads/master@{#350647} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: ca0e19488b8e75ae5546c09f89787dec580f0916
2015-09-24 23:27:11 +03:00
J('gyp', 'util', 'md5_check_test.py'),
J('play_services', 'update_test.py'),
J('pylib', 'base', 'test_dispatcher_unittest.py'),
J('pylib', 'gtest', 'gtest_test_instance_test.py'),
J('pylib', 'instrumentation',
'instrumentation_test_instance_test.py'),
J('pylib', 'local', 'device', 'local_device_test_run_test.py'),
J('pylib', 'results', 'json_results_test.py'),
J('pylib', 'symbols', 'elf_symbolizer_unittest.py'),
],
env=pylib_test_env))
return output
def CheckChangeOnUpload(input_api, output_api):
return CommonChecks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return CommonChecks(input_api, output_api)