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

Unified Diff: build/android/pylib/gtest/gtest_test_instance.py

Issue 2405063002: Tweak --gtest_filter_file switch to support blank lines and comment lines. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/gtest_test_instance.py
diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py
index 8858297a70f0b3765ca46e562a151c914d4166ad..f9c6e5911b6aecf0147de3e07fd2396fbba0b624 100644
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -252,7 +252,13 @@ class GtestTestInstance(test_instance.TestInstance):
self._gtest_filter = args.test_filter
elif args.test_filter_file:
with open(args.test_filter_file, 'r') as f:
- self._gtest_filter = ':'.join(l.strip() for l in f)
+ # Strip whitespace + skip empty lines and lines beginning with '#'.
+ # This should be consistent with processing of
+ # --test-launcher-filter-file in base/test/launcher/test_launcher.cc.
+ stripped_lines = (l.strip() for l in f)
+ filter_lines = (l for l in stripped_lines if l and l[0] != '#')
+ # Join the filter lines into one, big --gtest_filter argument.
+ self._gtest_filter = ':'.join(filter_lines)
else:
self._gtest_filter = None
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698