diff options
author | qyearsley <qyearsley@chromium.org> | 2014-08-31 21:27:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-01 04:28:46 +0000 |
commit | da5d7ad196c83ceefbd66b44178bba4ab9f29b98 (patch) | |
tree | 4c75112f9ec8d766bde868e021e1d3fa8cc1092d /tools/auto_bisect/run_tests | |
parent | d6768ca8c6658005b3485f4c7a7a167ec49f88fd (diff) | |
download | chromium_src-da5d7ad196c83ceefbd66b44178bba4ab9f29b98.zip chromium_src-da5d7ad196c83ceefbd66b44178bba4ab9f29b98.tar.gz chromium_src-da5d7ad196c83ceefbd66b44178bba4ab9f29b98.tar.bz2 |
In the presubmit for auto-bisect, run pylint and unit tests.
Note: This only runs pylint and tests for the auto_bisect directory (this was much simpler than picking and choosing particular files from the parent tools directory).
I think the next step is to move bisect-perf-regression.py and related files into the auto_bisect directory.
BUG=
Review URL: https://codereview.chromium.org/529593002
Cr-Commit-Position: refs/heads/master@{#292833}
Diffstat (limited to 'tools/auto_bisect/run_tests')
-rwxr-xr-x | tools/auto_bisect/run_tests | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/auto_bisect/run_tests b/tools/auto_bisect/run_tests new file mode 100755 index 0000000..0ee241e --- /dev/null +++ b/tools/auto_bisect/run_tests @@ -0,0 +1,27 @@ +#!/usr/bin/env 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. + +"""Runs all tests in all unit test modules in this directory.""" + +import os +import sys +import unittest + + +def main(): + suite = unittest.TestSuite() + loader = unittest.TestLoader() + + # Add all tests in the directory. + 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()) |