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

Unified Diff: presubmit_canned_checks.py

Issue 7906009: Fix a typo that resulted in no tests to be run in depot_tools. :( (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: More Created 9 years, 3 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 | « PRESUBMIT.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 aeb2711451df919ab61256106b315de4bbe7b49a..607ce8c76507427c7eeb72275a1db334403cc0e8 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -477,7 +477,9 @@ def RunUnitTestsInDirectory(
def check(filename, filters):
return any(True for i in filters if input_api.re.match(i, filename))
+ to_run = found = 0
for filename in input_api.os_listdir(test_path):
+ found += 1
fullpath = input_api.os_path.join(test_path, filename)
if not input_api.os_path.isfile(fullpath):
continue
@@ -486,6 +488,14 @@ def RunUnitTestsInDirectory(
if blacklist and check(filename, blacklist):
continue
unit_tests.append(input_api.os_path.join(directory, filename))
+ to_run += 1
+ input_api.logging.debug('Found %d files, running %d' % (found, to_run))
+ if not to_run:
+ return [
+ output_api.PresubmitPromptWarning(
+ 'Out of %d files, found none that matched w=%r, b=%r in directory %s'
+ % (found, whitelist, blacklist, directory))
+ ]
return RunUnitTests(input_api, output_api, unit_tests)
« no previous file with comments | « PRESUBMIT.py ('k') | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698