| 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 """ | 5 """ |
| 6 Classes in this file define additional actions that need to be taken to run a | 6 Classes in this file define additional actions that need to be taken to run a |
| 7 test under some kind of runtime error detection tool. | 7 test under some kind of runtime error detection tool. |
| 8 | 8 |
| 9 The interface is intended to be used as follows. | 9 The interface is intended to be used as follows. |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 device.old_interface.SetUtilWrapper(self.GetUtilWrapper()) | 109 device.old_interface.SetUtilWrapper(self.GetUtilWrapper()) |
| 110 | 110 |
| 111 @classmethod | 111 @classmethod |
| 112 def CopyFiles(cls, device): | 112 def CopyFiles(cls, device): |
| 113 """Copies ASan tools to the device.""" | 113 """Copies ASan tools to the device.""" |
| 114 libs = glob.glob(os.path.join(DIR_SOURCE_ROOT, | 114 libs = glob.glob(os.path.join(DIR_SOURCE_ROOT, |
| 115 'third_party/llvm-build/Release+Asserts/', | 115 'third_party/llvm-build/Release+Asserts/', |
| 116 'lib/clang/*/lib/linux/', | 116 'lib/clang/*/lib/linux/', |
| 117 'libclang_rt.asan-arm-android.so')) | 117 'libclang_rt.asan-arm-android.so')) |
| 118 assert len(libs) == 1 | 118 assert len(libs) == 1 |
| 119 subprocess.call([os.path.join(DIR_SOURCE_ROOT, | 119 subprocess.call( |
| 120 'tools/android/asan/asan_device_setup.sh'), | 120 [os.path.join( |
| 121 '--device', str(device), | 121 DIR_SOURCE_ROOT, |
| 122 '--lib', libs[0], | 122 'tools/android/asan/third_party/asan_device_setup.sh'), |
| 123 '--extra-options', AddressSanitizerTool.EXTRA_OPTIONS]) | 123 '--device', str(device), |
| 124 '--lib', libs[0], |
| 125 '--extra-options', AddressSanitizerTool.EXTRA_OPTIONS]) |
| 124 device.WaitUntilFullyBooted() | 126 device.WaitUntilFullyBooted() |
| 125 | 127 |
| 126 def GetTestWrapper(self): | 128 def GetTestWrapper(self): |
| 127 return AddressSanitizerTool.WRAPPER_NAME | 129 return AddressSanitizerTool.WRAPPER_NAME |
| 128 | 130 |
| 129 def GetUtilWrapper(self): | 131 def GetUtilWrapper(self): |
| 130 """Returns the wrapper for utilities, such as forwarder. | 132 """Returns the wrapper for utilities, such as forwarder. |
| 131 | 133 |
| 132 AddressSanitizer wrapper must be added to all instrumented binaries, | 134 AddressSanitizer wrapper must be added to all instrumented binaries, |
| 133 including forwarder and the like. This can be removed if such binaries | 135 including forwarder and the like. This can be removed if such binaries |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return | 295 return |
| 294 | 296 |
| 295 clazz = TOOL_REGISTRY.get(tool_name) | 297 clazz = TOOL_REGISTRY.get(tool_name) |
| 296 if clazz: | 298 if clazz: |
| 297 clazz.CopyFiles(device) | 299 clazz.CopyFiles(device) |
| 298 else: | 300 else: |
| 299 print 'Unknown tool %s, available tools: %s' % ( | 301 print 'Unknown tool %s, available tools: %s' % ( |
| 300 tool_name, ', '.join(sorted(TOOL_REGISTRY.keys()))) | 302 tool_name, ', '.join(sorted(TOOL_REGISTRY.keys()))) |
| 301 sys.exit(1) | 303 sys.exit(1) |
| 302 | 304 |
| OLD | NEW |