Commit b43fc005 authored by Mikhail Khokhlov's avatar Mikhail Khokhlov Committed by Commit Bot

[tools/perf] Don't output in the same format twice

This CL restores the accidentally deleted fix for repeated --output-format
arguments.

Bug: 1023796
Change-Id: I247332772af7feb308d00564766b0ca898904cc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911790
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714589}
parent fc5589ac
......@@ -139,7 +139,9 @@ def ProcessOptions(options):
if not options.output_formats:
options.output_formats = ['html']
elif 'none' in options.output_formats:
else:
options.output_formats = sorted(set(options.output_formats))
if 'none' in options.output_formats:
options.output_formats.remove('none')
......
......@@ -129,6 +129,12 @@ class TestProcessOptions(ProcessOptionsTestCase):
with self.assertRaises(SystemExit):
self.ParseArgs(['--output-format', 'unknown'])
def testNoDuplicateOutputFormats(self):
options = self.ParseArgs(
['--output-format', 'html', '--output-format', 'csv',
'--output-format', 'html', '--output-format', 'csv'])
self.assertEqual(options.output_formats, ['csv', 'html'])
class StandaloneTestProcessOptions(ProcessOptionsTestCase):
def setUp(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment