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

Unified Diff: tools/deep_memory_profiler/visualizer/run_tests.py

Issue 23781012: Upload file to app engine and generate public url for dmprof visualizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add default_template attribute validation Created 7 years, 3 months 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: 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
+
Dai Mikurube (NOT FULLTIME) 2013/09/24 07:22:11 One more empty line.
junjianx 2013/09/24 08:11:21 Done.
+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__':
Dai Mikurube (NOT FULLTIME) 2013/09/24 07:22:11 This clause should be simpler, just calling main()
junjianx 2013/09/24 08:11:21 Done.
+ 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)

Powered by Google App Engine
This is Rietveld 408576698