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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 # Test that we set a finite batch size for sanitizer builds. | 138 # Test that we set a finite batch size for sanitizer builds. |
139 port._options.enable_sanitizer = True | 139 port._options.enable_sanitizer = True |
140 sanitized_batch_size = port.default_batch_size() | 140 sanitized_batch_size = port.default_batch_size() |
141 self.assertIsNotNone(sanitized_batch_size) | 141 self.assertIsNotNone(sanitized_batch_size) |
142 | 142 |
143 def test_default_child_processes(self): | 143 def test_default_child_processes(self): |
144 port = self.make_port() | 144 port = self.make_port() |
145 num_workers = port.default_child_processes() | 145 num_workers = port.default_child_processes() |
146 self.assertGreaterEqual(num_workers, 1) | 146 self.assertGreaterEqual(num_workers, 1) |
147 | 147 |
148 # Test that we reduce the number of workers for sanitizer builds. | |
149 port._options.enable_sanitizer = True | |
150 port.host.executive.cpu_count = lambda: 8 | |
151 num_sanitized_workers = port.default_child_processes() | |
152 self.assertLess(num_sanitized_workers, 8) | |
153 | |
154 def test_default_max_locked_shards(self): | 148 def test_default_max_locked_shards(self): |
155 port = self.make_port() | 149 port = self.make_port() |
156 port.default_child_processes = lambda: 16 | 150 port.default_child_processes = lambda: 16 |
157 self.assertEqual(port.default_max_locked_shards(), 4) | 151 self.assertEqual(port.default_max_locked_shards(), 4) |
158 port.default_child_processes = lambda: 2 | 152 port.default_child_processes = lambda: 2 |
159 self.assertEqual(port.default_max_locked_shards(), 1) | 153 self.assertEqual(port.default_max_locked_shards(), 1) |
160 | 154 |
161 def test_default_timeout_ms(self): | 155 def test_default_timeout_ms(self): |
162 self.assertEqual(self.make_port(options=MockOptions(configuration='Relea
se')).default_timeout_ms(), 6000) | 156 self.assertEqual(self.make_port(options=MockOptions(configuration='Relea
se')).default_timeout_ms(), 6000) |
163 self.assertEqual(self.make_port(options=MockOptions(configuration='Debug
')).default_timeout_ms(), 18000) | 157 self.assertEqual(self.make_port(options=MockOptions(configuration='Debug
')).default_timeout_ms(), 18000) |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 def test_additional_platform_directory(self): | 479 def test_additional_platform_directory(self): |
486 port = self.make_port(options=MockOptions(additional_platform_directory=
['/tmp/foo'])) | 480 port = self.make_port(options=MockOptions(additional_platform_directory=
['/tmp/foo'])) |
487 self.assertEqual(port.baseline_search_path()[0], '/tmp/foo') | 481 self.assertEqual(port.baseline_search_path()[0], '/tmp/foo') |
488 | 482 |
489 def test_virtual_test_suites(self): | 483 def test_virtual_test_suites(self): |
490 # We test that we can load the real LayoutTests/VirtualTestSuites file p
roperly, so we | 484 # We test that we can load the real LayoutTests/VirtualTestSuites file p
roperly, so we |
491 # use a real SystemHost(). We don't care what virtual_test_suites() retu
rns as long | 485 # use a real SystemHost(). We don't care what virtual_test_suites() retu
rns as long |
492 # as it is iterable. | 486 # as it is iterable. |
493 port = self.make_port(host=SystemHost(), port_name=self.full_port_name) | 487 port = self.make_port(host=SystemHost(), port_name=self.full_port_name) |
494 self.assertTrue(isinstance(port.virtual_test_suites(), collections.Itera
ble)) | 488 self.assertTrue(isinstance(port.virtual_test_suites(), collections.Itera
ble)) |
OLD | NEW |