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

Unified Diff: tools/checkteamtags/run_tests

Issue 2601773004: Adding check for team and component tags in owners files. (Closed)
Patch Set: Addressing comments and adding tests Created 4 years 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/checkteamtags/run_tests
diff --git a/tools/checkteamtags/run_tests b/tools/checkteamtags/run_tests
new file mode 100755
index 0000000000000000000000000000000000000000..c027469e39aed8fb16ebca81d5258310abbcb636
--- /dev/null
+++ b/tools/checkteamtags/run_tests
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
stgao 2017/01/03 22:47:00 nit: 2014 -> 2016/2017. If we go with 2017, we ne
RobertoCN 2017/01/04 18:48:59 Done.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Runs all tests in all unit test modules in this directory."""
+
+import os
+import sys
+import unittest
+import logging
+
+SRC = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)
+
+
+def main():
+ if 'full-log' in sys.argv:
+ # Configure logging to show line numbers and logging level
+ fmt = '%(module)s:%(lineno)d - %(levelname)s: %(message)s'
+ logging.basicConfig(level=logging.DEBUG, stream=sys.stdout, format=fmt)
+ elif 'no-log' in sys.argv:
+ # Only WARN and above are shown, to standard error. (This is the logging
+ # module default config, hence we do nothing here)
+ pass
+ else:
+ # Behave as before. Make logging.info mimic print behavior
+ fmt = '%(message)s'
+ logging.basicConfig(level=logging.INFO, stream=sys.stdout, format=fmt)
+
+ suite = unittest.TestSuite()
+ loader = unittest.TestLoader()
+ script_dir = os.path.dirname(__file__)
+ suite.addTests(loader.discover(start_dir=script_dir, pattern='*_test.py'))
+
+ print 'Running unit tests in %s...' % os.path.abspath(script_dir)
+ result = unittest.TextTestRunner(verbosity=1).run(suite)
+ return 0 if result.wasSuccessful() else 1
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« tools/checkteamtags/checkteamtags_test.py ('K') | « tools/checkteamtags/checkteamtags_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698