| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from master.factory import chromium_factory | 5 from master.factory import chromium_factory |
| 6 from master.factory import gclient_factory | 6 from master.factory import gclient_factory |
| 7 from master.factory import chromium_commands | 7 from master.factory import chromium_commands |
| 8 | 8 |
| 9 import config | 9 import config |
| 10 | 10 |
| 11 | 11 |
| 12 class WebRTCFactory(chromium_factory.ChromiumFactory): | 12 class WebRTCFactory(chromium_factory.ChromiumFactory): |
| 13 | 13 |
| 14 CUSTOM_VARS_ROOT_DIR = ('root_dir', 'src') | 14 CUSTOM_VARS_ROOT_DIR = ('root_dir', 'src') |
| 15 | 15 |
| 16 # Can't use the same Valgrind constant as in chromium_factory.py, since WebRTC | 16 # Can't use the same Valgrind constant as in chromium_factory.py, since WebRTC |
| 17 # uses another path (use_relative_paths=True in DEPS). | 17 # uses another path (use_relative_paths=True in DEPS). |
| 18 CUSTOM_DEPS_VALGRIND = ('third_party/valgrind', | 18 CUSTOM_DEPS_VALGRIND = ('third_party/valgrind', |
| 19 config.Master.trunk_url + '/deps/third_party/valgrind/binaries') | 19 config.Master.trunk_url + '/deps/third_party/valgrind/binaries') |
| 20 CUSTOM_DEPS_TSAN_WIN = ('third_party/tsan', |
| 21 config.Master.trunk_url + '/deps/third_party/tsan') |
| 20 | 22 |
| 21 def __init__(self, build_dir, target_platform, nohooks_on_update=False, | 23 def __init__(self, build_dir, target_platform, nohooks_on_update=False, |
| 22 target_os=None): | 24 target_os=None): |
| 23 """Creates a WebRTC factory. | 25 """Creates a WebRTC factory. |
| 24 | 26 |
| 25 This factory can also be used to build stand-alone projects. | 27 This factory can also be used to build stand-alone projects. |
| 26 | 28 |
| 27 Args: | 29 Args: |
| 28 build_dir: Directory to perform the build relative to. Usually this is | 30 build_dir: Directory to perform the build relative to. Usually this is |
| 29 trunk/build for WebRTC and other projects. | 31 trunk/build for WebRTC and other projects. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 52 def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None, | 54 def WebRTCFactory(self, target='Debug', clobber=False, tests=None, mode=None, |
| 53 slave_type='BuilderTester', options=None, | 55 slave_type='BuilderTester', options=None, |
| 54 compile_timeout=1200, build_url=None, project=None, | 56 compile_timeout=1200, build_url=None, project=None, |
| 55 factory_properties=None, gclient_deps=None): | 57 factory_properties=None, gclient_deps=None): |
| 56 options = options or '' | 58 options = options or '' |
| 57 tests = tests or [] | 59 tests = tests or [] |
| 58 factory_properties = factory_properties or {} | 60 factory_properties = factory_properties or {} |
| 59 | 61 |
| 60 if factory_properties.get('needs_valgrind'): | 62 if factory_properties.get('needs_valgrind'): |
| 61 self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND] | 63 self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_VALGRIND] |
| 64 elif factory_properties.get('needs_tsan_win'): |
| 65 self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_TSAN_WIN] |
| 66 elif factory_properties.get('needs_drmemory'): |
| 67 if 'drmemory.DEPS' not in [s.name for s in self._solutions]: |
| 68 self._solutions.append(gclient_factory.GClientSolution( |
| 69 config.Master.trunk_url + |
| 70 '/deps/third_party/drmemory/drmemory.DEPS', |
| 71 'drmemory.DEPS')) |
| 72 |
| 62 factory = self.BuildFactory(target, clobber, tests, mode, slave_type, | 73 factory = self.BuildFactory(target, clobber, tests, mode, slave_type, |
| 63 options, compile_timeout, build_url, project, | 74 options, compile_timeout, build_url, project, |
| 64 factory_properties, gclient_deps) | 75 factory_properties, gclient_deps) |
| 65 | 76 |
| 66 # Get the factory command object to create new steps to the factory. | 77 # Get the factory command object to create new steps to the factory. |
| 67 cmds = chromium_commands.ChromiumCommands(factory, target, self._build_dir, | 78 cmds = chromium_commands.ChromiumCommands(factory, target, self._build_dir, |
| 68 self._target_platform) | 79 self._target_platform) |
| 69 # Override test runner script paths with our own that can run any test and | 80 # Override test runner script paths with our own that can run any test and |
| 70 # have our suppressions configured. | 81 # have our suppressions configured. |
| 71 valgrind_script_path = cmds.PathJoin('src', 'tools', 'valgrind-webrtc') | 82 valgrind_script_path = cmds.PathJoin('src', 'tools', 'valgrind-webrtc') |
| 72 cmds._posix_memory_tests_runner = cmds.PathJoin(valgrind_script_path, | 83 cmds._posix_memory_tests_runner = cmds.PathJoin(valgrind_script_path, |
| 73 'webrtc_tests.sh') | 84 'webrtc_tests.sh') |
| 74 cmds._win_memory_tests_runner = cmds.PathJoin(valgrind_script_path, | 85 cmds._win_memory_tests_runner = cmds.PathJoin(valgrind_script_path, |
| 75 'webrtc_tests.bat') | 86 'webrtc_tests.bat') |
| 76 | 87 |
| 77 # Add check/start step for virtual webcams, if needed. | 88 # Add check/start step for virtual webcams, if needed. |
| 78 if factory_properties.get('virtual_webcam'): | 89 if factory_properties.get('virtual_webcam'): |
| 79 cmds.AddVirtualWebcamCheck() | 90 cmds.AddVirtualWebcamCheck() |
| 80 | 91 |
| 81 cmds.AddWebRTCTests(tests, factory_properties) | 92 cmds.AddWebRTCTests(tests, factory_properties) |
| 82 return factory | 93 return factory |
| 94 |
| OLD | NEW |