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

Unified Diff: expect_tests/main.py

Issue 1915163005: expect_tests: add options to enable per-module runs. (Closed) Base URL: https://chromium.googlesource.com/infra/testing/expect_tests.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: expect_tests/main.py
diff --git a/expect_tests/main.py b/expect_tests/main.py
index 38510c9568887def042ad73e72adea960bd46c58..c139b6cbc15af6edf53a7852edc4cc8f11e16ce0 100644
--- a/expect_tests/main.py
+++ b/expect_tests/main.py
@@ -60,6 +60,10 @@ def _parse_args(args):
help='Disable coverage report.')
sp.add_argument(
+ '--coveragerc', metavar='FILE',
+ help='File to read coverage configuration. Default: .coveragerc')
+
+ sp.add_argument(
'--test-list', '--test_list', metavar='FILE',
help='take the list of test globs from the FILE (use "-" for stdin)'
).completer = lambda **_: []
@@ -70,6 +74,11 @@ def _parse_args(args):
).completer = lambda **_: []
sp.add_argument(
+ '--html-report-subdir', '--html_report_subdir', metavar='DIR',
+ help=('additional relative path within --html-report to write html '
+ 'report (default: empty)'))
+
+ sp.add_argument(
'--leak-temp', '--leak_temp', action='store_true',
help='leak temporary directory for debugging (default: False)'
)
@@ -152,8 +161,13 @@ def main(cover_branches=True, args=None):
opts = _parse_args(args)
skip_loop = opts.handler.SKIP_RUNLOOP
- cover_ctx = CoverageContext(cover_branches, opts.html_report,
- not skip_loop)
+ html_report = opts.html_report
+ if html_report and opts.html_report_subdir:
+ html_report = os.path.join(html_report, opts.html_report_subdir)
+
+ cover_ctx = CoverageContext(cover_branches, html_report,
+ enabled=not skip_loop,
+ coveragerc=opts.coveragerc)
# This is a quick hack to disable rude modules from implicitly configuring
# basic logging at import-time.
« 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