[Vim/YCM] Fix hang/crash when no Clang command line is available.
Previously, we tried to determine the command line for building a source
file by looking at the first output of said source file. This doesn't
work if the first output doesn't yield a clang command line. This patch
attempts to resolve this issue by going through all the build outputs of
a source file until one is found that yields a clang command line.
It is still possible to not find a Clang command line. In this case,
patch causes a graceful failure, rather than a crash.
[email protected],[email protected]
BUG=497787
Review URL: https://codereview.chromium.org/1156223007
Cr-Commit-Position: refs/heads/master@{#336467}
diff --git a/tools/vim/PRESUBMIT.py b/tools/vim/PRESUBMIT.py
new file mode 100644
index 0000000..8b0e945b
--- /dev/null
+++ b/tools/vim/PRESUBMIT.py
@@ -0,0 +1,12 @@
+# 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):
+ return input_api.canned_checks.RunUnitTestsInDirectory(
+ input_api, output_api, 'tests', whitelist=r'.*test.py')