Index: tools/deep_memory_profiler/visualizer/run_tests.py |
diff --git a/tools/deep_memory_profiler/visualizer/run_tests.py b/tools/deep_memory_profiler/visualizer/run_tests.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..2ff0beb487c59253e15ace006c5dacb5bdc9627b |
--- /dev/null |
+++ b/tools/deep_memory_profiler/visualizer/run_tests.py |
@@ -0,0 +1,36 @@ |
+#!/usr/bin/python |
+# Copyright 2013 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 optparse |
+import os |
+import sys |
+import unittest |
+ |
+USAGE = """%prog SDK_PATH |
+Run unit tests for App Engine apps. |
+SDK_PATH Path to the google_appengine installation""" |
+ |
+ |
+def main(sdk_path): |
+ sys.path.insert(0, sdk_path) |
+ import dev_appserver |
+ dev_appserver.fix_sys_path() |
+ path = os.path.dirname(os.path.abspath(__file__)) |
+ suite = unittest.loader.TestLoader().discover( |
+ path, |
+ pattern='*_unittest.py' |
+ ) |
+ unittest.TextTestRunner(verbosity=2).run(suite) |
+ |
+ |
+if __name__ == '__main__': |
+ parser = optparse.OptionParser(USAGE) |
+ options, args = parser.parse_args() |
+ if len(args) != 1: |
+ print 'Error: Exactly 1 arguments required.' |
+ parser.print_help() |
+ sys.exit(1) |
+ SDK_PATH = args[0] |
+ main(SDK_PATH) |