summaryrefslogtreecommitdiffstats
path: root/tools/purify/purify_test.py
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-11 22:24:57 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-11 22:24:57 +0000
commit699614ff7a85fe28c2a088dc611dac3192bea807 (patch)
tree29294e39ac73d494739767620096b4ac421633e6 /tools/purify/purify_test.py
parent94558e636ae78dfaaa996fe5b02416aad67992ca (diff)
downloadchromium_src-699614ff7a85fe28c2a088dc611dac3192bea807.zip
chromium_src-699614ff7a85fe28c2a088dc611dac3192bea807.tar.gz
chromium_src-699614ff7a85fe28c2a088dc611dac3192bea807.tar.bz2
Preliminary support for running the ui_tests under Purify.
This current change doesn't quite work: the blocking instrumentation of chrome.dll succeeds, but when the ui_test runs, it re-instruments chrome.dll even though it exists under the same name in the instrumentation cache. Review URL: http://codereview.chromium.org/14003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/purify/purify_test.py')
-rw-r--r--tools/purify/purify_test.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/purify/purify_test.py b/tools/purify/purify_test.py
index a2733e7..2d8f48a 100644
--- a/tools/purify/purify_test.py
+++ b/tools/purify/purify_test.py
@@ -92,6 +92,8 @@ class Purify(common.Rational):
script_dir = google.path_utils.ScriptDir()
self._latest_dir = os.path.join(script_dir, "latest")
if common.Rational.Setup(self):
+ if self._instrument_only:
+ return True
pft_file = os.path.join(script_dir, "data", "filters.pft")
shutil.copyfile(pft_file, self._exe.replace(".exe", "_exe.pft"))
string_list = [
@@ -126,8 +128,11 @@ class Purify(common.Rational):
logging.error("file doesn't exist " + self._exe)
return False
cmd = self._PurifyCommand()
- # /Run=no means instrument only, /Replace=yes means replace the exe in place
- cmd.extend(["/Run=no", "/Replace=yes"])
+ # /Run=no means instrument
+ cmd.extend(["/Run=no"])
+ if not self._instrument_only:
+ # /Replace=yes means replace the exe in place
+ cmd.extend(["/Replace=yes"])
cmd.append(os.path.abspath(self._exe))
return common.Rational.Instrument(self, cmd)
@@ -198,6 +203,8 @@ class Purify(common.Rational):
def Cleanup(self):
common.Rational.Cleanup(self);
+ if self._instrument_only:
+ return
cmd = self._PurifyCommand()
# undo the /Replace=yes that was done in Instrument(), which means to
# remove the instrumented exe, and then rename exe.Original back to exe.