Fixed mach/servo logger choice for single files

This commit is contained in:
Sumant Manne 2017-01-28 10:29:30 -06:00
parent b5c94bad37
commit a2fe2e6095

View file

@ -32,7 +32,13 @@ def run_tests(paths=None, **kwargs):
mozlog.commandline.log_formatters["servo"] = \
(grouping_formatter.GroupingFormatter, "A grouping output formatter")
use_mach_logging = False
if len(kwargs["test_list"]) == 1:
file_ext = os.path.splitext(kwargs["test_list"][0])[1].lower()
if file_ext in [".htm", ".html", ".js", ".xhtml"]:
use_mach_logging = True
if use_mach_logging:
wptrunner.setup_logging(kwargs, {"mach": sys.stdout})
else:
wptrunner.setup_logging(kwargs, {"servo": sys.stdout})