| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 self.assertNotIn('build requirements', logs) # but not the driver i
tself. | 122 self.assertNotIn('build requirements', logs) # but not the driver i
tself. |
| 123 | 123 |
| 124 port._check_file_exists = lambda path, desc: False | 124 port._check_file_exists = lambda path, desc: False |
| 125 port._check_driver_build_up_to_date = lambda config: False | 125 port._check_driver_build_up_to_date = lambda config: False |
| 126 try: | 126 try: |
| 127 oc.capture_output() | 127 oc.capture_output() |
| 128 self.assertEqual(port.check_build(needs_http=True, printer=FakePrint
er()), | 128 self.assertEqual(port.check_build(needs_http=True, printer=FakePrint
er()), |
| 129 test_run_results.UNEXPECTED_ERROR_EXIT_STATUS) | 129 test_run_results.UNEXPECTED_ERROR_EXIT_STATUS) |
| 130 finally: | 130 finally: |
| 131 out, err, logs = oc.restore_output() | 131 out, err, logs = oc.restore_output() |
| 132 self.assertIn('pretty patches', logs) # And, hereere we shoul
d get warnings about both. | 132 self.assertIn('pretty patches', logs) # And, here we should g
et warnings about both. |
| 133 self.assertIn('build requirements', logs) | 133 self.assertIn('build requirements', logs) |
| 134 | 134 |
| 135 def test_default_batch_size(self): |
| 136 port = self.make_port() |
| 137 |
| 138 # Test that we set a finite batch size for sanitizer builds. |
| 139 port._options.enable_sanitizer = True |
| 140 sanitized_batch_size = port.default_batch_size() |
| 141 self.assertIsNotNone(sanitized_batch_size) |
| 142 |
| 135 def test_default_child_processes(self): | 143 def test_default_child_processes(self): |
| 136 port = self.make_port() | 144 port = self.make_port() |
| 137 num_workers = port.default_child_processes() | 145 num_workers = port.default_child_processes() |
| 138 self.assertGreaterEqual(num_workers, 1) | 146 self.assertGreaterEqual(num_workers, 1) |
| 139 | 147 |
| 140 # Test that we reduce the number of workers for sanitizer builds. | 148 # Test that we reduce the number of workers for sanitizer builds. |
| 141 port._options.enable_sanitizer = True | 149 port._options.enable_sanitizer = True |
| 142 port.host.executive.cpu_count = lambda: 8 | 150 port.host.executive.cpu_count = lambda: 8 |
| 143 num_sanitized_workers = port.default_child_processes() | 151 num_sanitized_workers = port.default_child_processes() |
| 144 self.assertLess(num_sanitized_workers, 8) | 152 self.assertLess(num_sanitized_workers, 8) |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 def test_additional_platform_directory(self): | 485 def test_additional_platform_directory(self): |
| 478 port = self.make_port(options=MockOptions(additional_platform_directory=
['/tmp/foo'])) | 486 port = self.make_port(options=MockOptions(additional_platform_directory=
['/tmp/foo'])) |
| 479 self.assertEqual(port.baseline_search_path()[0], '/tmp/foo') | 487 self.assertEqual(port.baseline_search_path()[0], '/tmp/foo') |
| 480 | 488 |
| 481 def test_virtual_test_suites(self): | 489 def test_virtual_test_suites(self): |
| 482 # We test that we can load the real LayoutTests/VirtualTestSuites file p
roperly, so we | 490 # We test that we can load the real LayoutTests/VirtualTestSuites file p
roperly, so we |
| 483 # use a real SystemHost(). We don't care what virtual_test_suites() retu
rns as long | 491 # use a real SystemHost(). We don't care what virtual_test_suites() retu
rns as long |
| 484 # as it is iterable. | 492 # as it is iterable. |
| 485 port = self.make_port(host=SystemHost(), port_name=self.full_port_name) | 493 port = self.make_port(host=SystemHost(), port_name=self.full_port_name) |
| 486 self.assertTrue(isinstance(port.virtual_test_suites(), collections.Itera
ble)) | 494 self.assertTrue(isinstance(port.virtual_test_suites(), collections.Itera
ble)) |
| OLD | NEW |