| 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 12 matching lines...) Expand all Loading... |
| 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 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.layout_tests.port.test import TestPort | |
| 34 from webkitpy.tool.commands.queries import * | 33 from webkitpy.tool.commands.queries import * |
| 35 from webkitpy.tool.mock_tool import MockTool, MockOptions | 34 from webkitpy.tool.mock_tool import MockWebKitPatch, MockOptions |
| 36 | 35 |
| 37 | 36 |
| 38 class PrintExpectationsTest(unittest.TestCase): | 37 class PrintExpectationsTest(unittest.TestCase): |
| 39 | 38 |
| 40 def run_test(self, tests, expected_stdout, platform='test-win-win7', **args)
: | 39 def run_test(self, tests, expected_stdout, platform='test-win-win7', **args)
: |
| 41 options = MockOptions(all=False, csv=False, full=False, platform=platfor
m, | 40 options = MockOptions(all=False, csv=False, full=False, platform=platfor
m, |
| 42 include_keyword=[], exclude_keyword=[], paths=Fals
e).update(**args) | 41 include_keyword=[], exclude_keyword=[], paths=Fals
e).update(**args) |
| 43 tool = MockTool() | 42 tool = MockWebKitPatch() |
| 44 tool.port_factory.all_port_names = lambda: [ | 43 tool.port_factory.all_port_names = lambda: [ |
| 45 'test-linux-trusty', 'test-linux-precise', | 44 'test-linux-trusty', 'test-linux-precise', |
| 46 'test-mac-mac10.11', 'test-mac-mac10.10', | 45 'test-mac-mac10.11', 'test-mac-mac10.10', |
| 47 'test-win-win10', 'test-win-win7' | 46 'test-win-win10', 'test-win-win7' |
| 48 ] | 47 ] |
| 49 command = PrintExpectations() | 48 command = PrintExpectations() |
| 50 command.bind_to_tool(tool) | 49 command.bind_to_tool(tool) |
| 51 | 50 |
| 52 oc = OutputCapture() | 51 oc = OutputCapture() |
| 53 try: | 52 try: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 'LayoutTests/NeverFixTests\n' | 104 'LayoutTests/NeverFixTests\n' |
| 106 'LayoutTests/StaleTestExpectations\n' | 105 'LayoutTests/StaleTestExpectations\n' |
| 107 'LayoutTests/SlowTests\n'), | 106 'LayoutTests/SlowTests\n'), |
| 108 paths=True) | 107 paths=True) |
| 109 | 108 |
| 110 | 109 |
| 111 class PrintBaselinesTest(unittest.TestCase): | 110 class PrintBaselinesTest(unittest.TestCase): |
| 112 | 111 |
| 113 def setUp(self): | 112 def setUp(self): |
| 114 self.oc = None | 113 self.oc = None |
| 115 self.tool = MockTool() | 114 self.tool = MockWebKitPatch() |
| 116 self.test_port = self.tool.port_factory.get('test-win-win7') | 115 self.test_port = self.tool.port_factory.get('test-win-win7') |
| 117 self.tool.port_factory.get = lambda port_name=None: self.test_port | 116 self.tool.port_factory.get = lambda port_name=None: self.test_port |
| 118 self.tool.port_factory.all_port_names = lambda: [ | 117 self.tool.port_factory.all_port_names = lambda: [ |
| 119 'test-linux-trusty', 'test-linux-precise', | 118 'test-linux-trusty', 'test-linux-precise', |
| 120 'test-mac-mac10.11', 'test-mac-mac10.10', | 119 'test-mac-mac10.11', 'test-mac-mac10.10', |
| 121 'test-win-win10', 'test-win-win7' | 120 'test-win-win10', 'test-win-win7' |
| 122 ] | 121 ] |
| 123 | 122 |
| 124 def tearDown(self): | 123 def tearDown(self): |
| 125 if self.oc: | 124 if self.oc: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 def test_csv(self): | 164 def test_csv(self): |
| 166 command = PrintBaselines() | 165 command = PrintBaselines() |
| 167 command.bind_to_tool(self.tool) | 166 command.bind_to_tool(self.tool) |
| 168 self.capture_output() | 167 self.capture_output() |
| 169 command.execute(MockOptions(all=False, platform='*win7', csv=True, | 168 command.execute(MockOptions(all=False, platform='*win7', csv=True, |
| 170 include_virtual_tests=False), ['passes/text.
html'], self.tool) | 169 include_virtual_tests=False), ['passes/text.
html'], self.tool) |
| 171 stdout, _, _ = self.restore_output() | 170 stdout, _, _ = self.restore_output() |
| 172 self.assertMultiLineEqual(stdout, | 171 self.assertMultiLineEqual(stdout, |
| 173 ('test-win-win7,passes/text.html,None,png,pass
es/text-expected.png,None\n' | 172 ('test-win-win7,passes/text.html,None,png,pass
es/text-expected.png,None\n' |
| 174 'test-win-win7,passes/text.html,None,txt,pass
es/text-expected.txt,None\n')) | 173 'test-win-win7,passes/text.html,None,txt,pass
es/text-expected.txt,None\n')) |
| OLD | NEW |