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

Unified Diff: mojo/tools/run_mojo_python_tests.py

Issue 241713003: Add run_mojo_python_tests.py so that we can run the python tests on the bots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for review Created 6 years, 8 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
« mojo/tools/mojob.sh ('K') | « mojo/tools/mojob.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/run_mojo_python_tests.py
diff --git a/mojo/tools/run_mojo_python_tests.py b/mojo/tools/run_mojo_python_tests.py
new file mode 100755
index 0000000000000000000000000000000000000000..48b723cfd35f7738d45630c77514f2a75e1cf564
--- /dev/null
+++ b/mojo/tools/run_mojo_python_tests.py
@@ -0,0 +1,40 @@
+#!/bin/python
+# Copyright 2014 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
+
+
+# TODO(dpranke): crbug.com/364709 . We should add the ability to return
+# JSONified results data for the bots.
+
+
+def main():
+ parser = optparse.OptionParser()
+ parser.add_option('-v', '--verbose', action='count', default=0)
+ options, args = parser.parse_args()
+ if args:
+ parser.usage()
+ return 1
+
+ chromium_src_dir = os.path.join(os.path.dirname(__file__),
+ os.pardir,
+ os.pardir)
+
+ loader = unittest.loader.TestLoader()
+ print "Running Python unit tests under mojo/public/tools/bindings/pylib ..."
+ suite = loader.discover(os.path.join(chromium_src_dir, 'mojo', 'public',
+ 'tools', 'bindings', 'pylib'),
+ pattern='*_unittest.py')
+
+ runner = unittest.runner.TextTestRunner(verbosity=(options.verbose+1))
+ result = runner.run(suite)
+ return 0 if result.wasSuccessful() else 1
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« mojo/tools/mojob.sh ('K') | « mojo/tools/mojob.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698