Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tools/valgrind/browser_wrapper_win.py

Issue 8688006: Set up python BROWSER_WRAPPER for ui_tests under Dr. Memory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/valgrind/common.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/valgrind/browser_wrapper_win.py
===================================================================
--- tools/valgrind/browser_wrapper_win.py (revision 0)
+++ tools/valgrind/browser_wrapper_win.py (revision 0)
@@ -0,0 +1,40 @@
+# Copyright (c) 2011 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.
+
+import os
+import re
+import sys
+import subprocess
+
+# TODO(timurrrr): we may use it on POSIX too to avoid code duplication once we
+# support layout_tests, remove Dr. Memory specific code and verify it works
+# on a "clean" Mac.
+
+wrapper_pid = os.getpid()
+testcase_name = None
+for arg in sys.argv:
+ m = re.match("\-\-test\-name=(.*)", arg)
+ if m:
+ assert testcase_name is None
+ testcase_name = m.groups()[0]
+
+# arg #0 is the path to this python script
+cmd_to_run = sys.argv[1:]
+
+# TODO(timurrrr): this is Dr. Memory-specific
+# Usually, we pass "-logdir" "foo\bar\spam path" args to Dr. Memory.
+# To group reports per UI test, we want to put the reports for each test into a
+# separate directory. This code can be simplified when we have
+# http://code.google.com/p/drmemory/issues/detail?id=684 fixed.
+logdir_idx = cmd_to_run.index("-logdir")
+old_logdir = cmd_to_run[logdir_idx + 1]
+cmd_to_run[logdir_idx + 1] += "\\testcase.%d.logs" % wrapper_pid
+os.makedirs(cmd_to_run[logdir_idx + 1])
+
+if testcase_name:
+ f = open(old_logdir + "\\testcase.%d.name" % wrapper_pid, "w")
+ print >>f, testcase_name
+ f.close()
+
+exit(subprocess.call(cmd_to_run))
Property changes on: tools/valgrind/browser_wrapper_win.py
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « no previous file | tools/valgrind/common.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698