diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-06-27 15:16:34 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-17 10:35:44 +0100 |
commit | f4128f0e462e8c0ca2d3aabb99abd15e44e85c5b (patch) | |
tree | 2d2572130fb66dd773104fa0bafe6de32358fd62 /scripts | |
parent | 979be848e2dbc6476914dea95e3a8f4e69255268 (diff) | |
download | poky-f4128f0e462e8c0ca2d3aabb99abd15e44e85c5b.tar.gz |
oe-build-perf-test: use new unittest based framework
Convert scripts/oe-build-perf-test to be compatible with the new Python
unittest based buildperf test framework.
(From OE-Core rev: 249d99cd7ec00b3227c194eb4b9b21ea4dcb7315)
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/oe-build-perf-test | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test index 8142b0332b..786c715dfc 100755 --- a/scripts/oe-build-perf-test +++ b/scripts/oe-build-perf-test | |||
@@ -21,12 +21,15 @@ import logging | |||
21 | import os | 21 | import os |
22 | import shutil | 22 | import shutil |
23 | import sys | 23 | import sys |
24 | import unittest | ||
24 | from datetime import datetime | 25 | from datetime import datetime |
25 | 26 | ||
26 | sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib') | 27 | sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib') |
27 | import scriptpath | 28 | import scriptpath |
28 | scriptpath.add_oe_lib_path() | 29 | scriptpath.add_oe_lib_path() |
29 | from oeqa.buildperf import BuildPerfTestRunner, KernelDropCaches | 30 | import oeqa.buildperf |
31 | from oeqa.buildperf import (BuildPerfTestLoader, BuildPerfTestResult, | ||
32 | BuildPerfTestRunner, KernelDropCaches) | ||
30 | from oeqa.utils.commands import runCmd | 33 | from oeqa.utils.commands import runCmd |
31 | 34 | ||
32 | 35 | ||
@@ -123,19 +126,23 @@ def main(argv=None): | |||
123 | # Check our capability to drop caches and ask pass if needed | 126 | # Check our capability to drop caches and ask pass if needed |
124 | KernelDropCaches.check() | 127 | KernelDropCaches.check() |
125 | 128 | ||
129 | # Load build perf tests | ||
130 | loader = BuildPerfTestLoader() | ||
131 | suite = loader.discover(start_dir=os.path.dirname(oeqa.buildperf.__file__)) | ||
126 | # Set-up log file | 132 | # Set-up log file |
127 | out_dir = args.out_dir.format(date=datetime.now().strftime('%Y%m%d%H%M%S')) | 133 | out_dir = args.out_dir.format(date=datetime.now().strftime('%Y%m%d%H%M%S')) |
128 | setup_file_logging(os.path.join(out_dir, 'output.log')) | 134 | setup_file_logging(os.path.join(out_dir, 'output.log')) |
129 | 135 | ||
130 | # Run actual tests | 136 | # Run actual tests |
131 | runner = BuildPerfTestRunner(out_dir) | ||
132 | archive_build_conf(out_dir) | 137 | archive_build_conf(out_dir) |
133 | ret = runner.run_tests() | 138 | runner = BuildPerfTestRunner(out_dir, verbosity=2) |
134 | if not ret: | 139 | result = runner.run(suite) |
140 | if result.wasSuccessful(): | ||
135 | if args.globalres_file: | 141 | if args.globalres_file: |
136 | runner.update_globalres_file(args.globalres_file) | 142 | result.update_globalres_file(args.globalres_file) |
143 | return 0 | ||
137 | 144 | ||
138 | return ret | 145 | return 1 |
139 | 146 | ||
140 | 147 | ||
141 | if __name__ == '__main__': | 148 | if __name__ == '__main__': |