Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: presubmit_canned_checks.py

Issue 6810012: Add verbose support throught presubmit checks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: merge error Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_cl.py ('k') | presubmit_support.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index 890b72cd18076f5d5a5ba6e36845a3f0474ef8da..f75d297ba3b7df29a61dea8095e09cfcf5a4bbb3 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -411,8 +411,7 @@ def CheckTreeIsOpen(input_api, output_api,
def RunUnitTestsInDirectory(
- input_api, output_api, directory, whitelist=None, blacklist=None,
- verbose=False):
+ input_api, output_api, directory, whitelist=None, blacklist=None):
"""Lists all files in a directory and runs them. Doesn't recurse.
It's mainly a wrapper for RunUnitTests. USe whitelist and blacklist to filter
@@ -434,10 +433,10 @@ def RunUnitTestsInDirectory(
if blacklist and check(filename, blacklist):
continue
unit_tests.append(input_api.os_path.join(directory, filename))
- return RunUnitTests(input_api, output_api, unit_tests, verbose)
+ return RunUnitTests(input_api, output_api, unit_tests)
-def RunUnitTests(input_api, output_api, unit_tests, verbose=False):
+def RunUnitTests(input_api, output_api, unit_tests):
"""Runs all unit tests in a directory.
On Windows, sys.executable is used for unit tests ending with ".py".
@@ -455,10 +454,10 @@ def RunUnitTests(input_api, output_api, unit_tests, verbose=False):
# Windows needs some help.
cmd = [input_api.python_executable]
cmd.append(unit_test)
- if verbose:
+ if input_api.verbose:
print('Running %s' % unit_test)
try:
- if verbose:
+ if input_api.verbose:
input_api.subprocess.check_call(cmd, cwd=input_api.PresubmitLocalPath())
else:
input_api.subprocess.check_output(
@@ -544,7 +543,6 @@ def RunPylint(input_api, output_api, white_list=None, black_list=None):
The default white_list enforces looking only a *.py files.
"""
- verbose = False
white_list = white_list or ['.*\.py$']
black_list = black_list or input_api.DEFAULT_BLACK_LIST
if input_api.is_committing:
@@ -590,7 +588,7 @@ def RunPylint(input_api, output_api, white_list=None, black_list=None):
return e.code
result = None
- if not verbose:
+ if not input_api.verbose:
result = run_lint(sorted(files))
else:
for filename in sorted(files):
« no previous file with comments | « git_cl.py ('k') | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698