Chromium Code Reviews| 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()) |