| OLD | NEW |
| 1 # Copyright (C) 2009 Google Inc. All rights reserved. | 1 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2012 Intel Corporation. All rights reserved. | 2 # Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 import unittest | 30 import unittest |
| 31 | 31 |
| 32 from webkitpy.common.system.outputcapture import OutputCapture | 32 from webkitpy.common.system.outputcapture import OutputCapture |
| 33 from webkitpy.tool.commands.queries import * | 33 from webkitpy.tool.commands.queries import * |
| 34 from webkitpy.tool.mock_tool import MockWebKitPatch, MockOptions | 34 from webkitpy.tool.mock_tool import MockWebKitPatch, MockOptions |
| 35 | 35 |
| 36 | 36 |
| 37 class PrintExpectationsTest(unittest.TestCase): | 37 class PrintExpectationsTest(unittest.TestCase): |
| 38 | 38 |
| 39 def run_test(self, tests, expected_stdout, platform='test-win-win7', **args)
: | 39 def run_test(self, tests, expected_stdout, platform='test-win-win7', **kwarg
s): |
| 40 options = MockOptions(all=False, csv=False, full=False, platform=platfor
m, | 40 options_defaults = { |
| 41 include_keyword=[], exclude_keyword=[], paths=Fals
e).update(**args) | 41 'all': False, 'csv': False, 'full': False, 'platform': platform, |
| 42 'include_keyword': [], 'exclude_keyword': [], 'paths': False, |
| 43 } |
| 44 options_defaults.update(kwargs) |
| 45 options = MockOptions(**options_defaults) |
| 42 tool = MockWebKitPatch() | 46 tool = MockWebKitPatch() |
| 43 tool.port_factory.all_port_names = lambda: [ | 47 tool.port_factory.all_port_names = lambda: [ |
| 44 'test-linux-trusty', 'test-linux-precise', | 48 'test-linux-trusty', 'test-linux-precise', |
| 45 'test-mac-mac10.11', 'test-mac-mac10.10', | 49 'test-mac-mac10.11', 'test-mac-mac10.10', |
| 46 'test-win-win10', 'test-win-win7' | 50 'test-win-win10', 'test-win-win7' |
| 47 ] | 51 ] |
| 48 command = PrintExpectations() | 52 command = PrintExpectations() |
| 49 command.bind_to_tool(tool) | 53 command.bind_to_tool(tool) |
| 50 | 54 |
| 51 oc = OutputCapture() | 55 oc = OutputCapture() |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 def test_csv(self): | 168 def test_csv(self): |
| 165 command = PrintBaselines() | 169 command = PrintBaselines() |
| 166 command.bind_to_tool(self.tool) | 170 command.bind_to_tool(self.tool) |
| 167 self.capture_output() | 171 self.capture_output() |
| 168 command.execute(MockOptions(all=False, platform='*win7', csv=True, | 172 command.execute(MockOptions(all=False, platform='*win7', csv=True, |
| 169 include_virtual_tests=False), ['passes/text.
html'], self.tool) | 173 include_virtual_tests=False), ['passes/text.
html'], self.tool) |
| 170 stdout, _, _ = self.restore_output() | 174 stdout, _, _ = self.restore_output() |
| 171 self.assertMultiLineEqual(stdout, | 175 self.assertMultiLineEqual(stdout, |
| 172 ('test-win-win7,passes/text.html,None,png,pass
es/text-expected.png,None\n' | 176 ('test-win-win7,passes/text.html,None,png,pass
es/text-expected.png,None\n' |
| 173 'test-win-win7,passes/text.html,None,txt,pass
es/text-expected.txt,None\n')) | 177 'test-win-win7,passes/text.html,None,txt,pass
es/text-expected.txt,None\n')) |
| OLD | NEW |