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

Unified Diff: webkit/tools/leak_tests/run_node_leak_test.py

Issue 8678022: Fix python scripts in src/webkit (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
Index: webkit/tools/leak_tests/run_node_leak_test.py
diff --git a/webkit/tools/leak_tests/run_node_leak_test.py b/webkit/tools/leak_tests/run_node_leak_test.py
index f45869ac6df051f6a24b0f644c7c87156b86aecb..83665d3de5aebe7e932e047cad18e54d51b12021 100755
--- a/webkit/tools/leak_tests/run_node_leak_test.py
+++ b/webkit/tools/leak_tests/run_node_leak_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
Dirk Pranke 2011/11/23 21:29:15 I bet this can go, too.
# Copyright (c) 2006-2008 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.
@@ -36,6 +36,7 @@ TEST_FILE_DIR = 'test_lists'
# been shamelessly taken from layout_tests/layout_package.
_webkit_root = None
+
def WebKitRoot():
"""Returns the full path to the directory containing webkit.sln. Raises
PathNotFound if we're unable to find webkit.sln.
@@ -70,7 +71,8 @@ def TestShellTestBinary(target):
raise PathNotFound('unable to find test_shell_tests at %s' % full_path)
return full_path
-class NodeLeakTestRunner:
+
+class NodeLeakTestRunner(object):
"""A class for managing running a series of node leak tests.
"""
@@ -192,7 +194,8 @@ class NodeLeakTestRunner:
status = REBASELINE
return (status, results, failed_urls, rebaseline_urls)
-def main(options, args):
+
+def run_node_leak_test(options, args):
if options.seed != None:
random.seed(options.seed)
@@ -259,7 +262,8 @@ def main(options, args):
return REBASELINE_EXIT_CODE
return 0
-if '__main__' == __name__:
+
+def main():
option_parser = optparse.OptionParser()
option_parser.add_option('', '--target', default='Debug',
help='build target (Debug or Release)')
@@ -275,5 +279,8 @@ if '__main__' == __name__:
'reproduce the exact same order for a '
'specific run')
options, args = option_parser.parse_args()
- sys.exit(main(options, args))
+ return run_node_leak_test(options, args)
+
+if '__main__' == __name__:
+ sys.exit(main())

Powered by Google App Engine
This is Rietveld 408576698