oe-build-perf-test: implement --run-tests option

Makes it possible to run only a subset of tests.

NOTE: The tests currently have (unwritten) dependencies on each other so
use this option with care. Mainly for debugging.

(From OE-Core rev: be4373be54e5b84f951771b0e75140f212838020)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen 2016-08-11 16:50:55 +03:00 committed by Richard Purdie
parent e484378325
commit c284616ffb
1 changed files with 6 additions and 1 deletions

View File

@ -105,6 +105,8 @@ def parse_args(argv):
help="Lock file to use")
parser.add_argument('-o', '--out-dir', default='results-{date}',
help="Output directory for test results")
parser.add_argument('--run-tests', nargs='+', metavar='TEST',
help="List of tests to run")
return parser.parse_args(argv)
@ -133,7 +135,10 @@ def main(argv=None):
# Load build perf tests
loader = BuildPerfTestLoader()
suite = loader.discover(start_dir=os.path.dirname(oeqa.buildperf.__file__))
if args.run_tests:
suite = loader.loadTestsFromNames(args.run_tests, oeqa.buildperf)
else:
suite = loader.loadTestsFromModule(oeqa.buildperf)
archive_build_conf(out_dir)
runner = BuildPerfTestRunner(out_dir, verbosity=2)