summaryrefslogtreecommitdiff
path: root/third_party/catapult/devil/devil/android/valgrind_tools
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/catapult/devil/devil/android/valgrind_tools')
-rw-r--r--third_party/catapult/devil/devil/android/valgrind_tools/__init__.py21
-rw-r--r--third_party/catapult/devil/devil/android/valgrind_tools/base_tool.py53
2 files changed, 74 insertions, 0 deletions
diff --git a/third_party/catapult/devil/devil/android/valgrind_tools/__init__.py b/third_party/catapult/devil/devil/android/valgrind_tools/__init__.py
new file mode 100644
index 0000000000..0182d4c176
--- /dev/null
+++ b/third_party/catapult/devil/devil/android/valgrind_tools/__init__.py
@@ -0,0 +1,21 @@
+# Copyright (c) 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+"""
+Classes in this package define additional actions that need to be taken to run a
+test under some kind of runtime error detection tool.
+
+The interface is intended to be used as follows.
+
+1. For tests that simply run a native process (i.e. no activity is spawned):
+
+Call tool.CopyFiles(device).
+Prepend test command line with tool.GetTestWrapper().
+
+2. For tests that spawn an activity:
+
+Call tool.CopyFiles(device).
+Call tool.SetupEnvironment().
+Run the test as usual.
+Call tool.CleanUpEnvironment().
+"""
diff --git a/third_party/catapult/devil/devil/android/valgrind_tools/base_tool.py b/third_party/catapult/devil/devil/android/valgrind_tools/base_tool.py
new file mode 100644
index 0000000000..2e6e9af3d3
--- /dev/null
+++ b/third_party/catapult/devil/devil/android/valgrind_tools/base_tool.py
@@ -0,0 +1,53 @@
+# Copyright (c) 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+class BaseTool(object):
+ """A tool that does nothing."""
+ # pylint: disable=R0201
+
+ def __init__(self):
+ """Does nothing."""
+ pass
+
+ def GetTestWrapper(self):
+ """Returns a string that is to be prepended to the test command line."""
+ return ''
+
+ def GetUtilWrapper(self):
+ """Returns the wrapper name for the utilities.
+
+ Returns:
+ A string that is to be prepended to the command line of utility
+ processes (forwarder, etc.).
+ """
+ return ''
+
+ @classmethod
+ def CopyFiles(cls, device):
+ """Copies tool-specific files to the device, create directories, etc."""
+ pass
+
+ def SetupEnvironment(self):
+ """Sets up the system environment for a test.
+
+ This is a good place to set system properties.
+ """
+ pass
+
+ def CleanUpEnvironment(self):
+ """Cleans up environment."""
+ pass
+
+ def GetTimeoutScale(self):
+ """Returns a multiplier that should be applied to timeout values."""
+ return 1.0
+
+ def NeedsDebugInfo(self):
+ """Whether this tool requires debug info.
+
+ Returns:
+ True if this tool can not work with stripped binaries.
+ """
+ return False