summaryrefslogtreecommitdiff
path: root/chromium/tools/vim/PRESUBMIT.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-05-09 14:22:11 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-05-09 15:11:45 +0000
commit2ddb2d3e14eef3de7dbd0cef553d669b9ac2361c (patch)
treee75f511546c5fd1a173e87c1f9fb11d7ac8d1af3 /chromium/tools/vim/PRESUBMIT.py
parenta4f3d46271c57e8155ba912df46a05559d14726e (diff)
downloadqtwebengine-chromium-2ddb2d3e14eef3de7dbd0cef553d669b9ac2361c.tar.gz
BASELINE: Update Chromium to 51.0.2704.41
Also adds in all smaller components by reversing logic for exclusion. Change-Id: Ibf90b506e7da088ea2f65dcf23f2b0992c504422 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'chromium/tools/vim/PRESUBMIT.py')
-rw-r--r--chromium/tools/vim/PRESUBMIT.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/chromium/tools/vim/PRESUBMIT.py b/chromium/tools/vim/PRESUBMIT.py
new file mode 100644
index 00000000000..33cdd6d82bc
--- /dev/null
+++ b/chromium/tools/vim/PRESUBMIT.py
@@ -0,0 +1,31 @@
+# Copyright 2015 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 tests for /tools/vim.
+
+Runs Python unit tests in /tools/vim/tests on upload.
+"""
+
+def CheckChangeOnUpload(input_api, output_api):
+ results = []
+
+ # affected_files is list of files affected by this change. The paths are
+ # relative to the directory containing PRESUBMIT.py.
+ affected_files = [
+ input_api.os_path.relpath(f, input_api.PresubmitLocalPath())
+ for f in input_api.AbsoluteLocalPaths()]
+
+ # Run the chromium.ycm_extra_conf_unittest test if the YCM config file is
+ # changed or if any change is affecting the tests directory. This specific
+ # test requires access to 'ninja' and hasn't been tested on platforms other
+ # than Linux.
+ if 'chromium.ycm_extra_conf.py' in affected_files or \
+ 'ninja_output.py' in affected_files or \
+ any([input_api.re.match(r'tests(/|\\)',f) for f in affected_files]):
+ results += input_api.RunTests(
+ input_api.canned_checks.GetUnitTests(
+ input_api, output_api,
+ ['tests/chromium.ycm_extra_conf_unittest.py']))
+
+ return results