]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-build-perf-test: implement --run-tests option
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 11 Aug 2016 13:50:55 +0000 (16:50 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 25 Aug 2016 21:59:51 +0000 (22:59 +0100)
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.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-build-perf-test

index 88af40ab7687ec9e5bbe5e830c7d12237a75ac45..808531efff0067ddc0ec70ef58404d98f60b4f28 100755 (executable)
@@ -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)