[oe-commits] [openembedded-core] 56/62: oe-build-perf-test: use new unittest based framework
git at git.openembedded.org
git at git.openembedded.org
Wed Aug 17 09:37:13 UTC 2016
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 249d99cd7ec00b3227c194eb4b9b21ea4dcb7315
Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
AuthorDate: Mon Jun 27 15:16:34 2016 +0300
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.
Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
scripts/oe-build-perf-test | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test
index 8142b03..786c715 100755
--- a/scripts/oe-build-perf-test
+++ b/scripts/oe-build-perf-test
@@ -21,12 +21,15 @@ import logging
import os
import shutil
import sys
+import unittest
from datetime import datetime
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
import scriptpath
scriptpath.add_oe_lib_path()
-from oeqa.buildperf import BuildPerfTestRunner, KernelDropCaches
+import oeqa.buildperf
+from oeqa.buildperf import (BuildPerfTestLoader, BuildPerfTestResult,
+ BuildPerfTestRunner, KernelDropCaches)
from oeqa.utils.commands import runCmd
@@ -123,19 +126,23 @@ def main(argv=None):
# Check our capability to drop caches and ask pass if needed
KernelDropCaches.check()
+ # Load build perf tests
+ loader = BuildPerfTestLoader()
+ suite = loader.discover(start_dir=os.path.dirname(oeqa.buildperf.__file__))
# Set-up log file
out_dir = args.out_dir.format(date=datetime.now().strftime('%Y%m%d%H%M%S'))
setup_file_logging(os.path.join(out_dir, 'output.log'))
# Run actual tests
- runner = BuildPerfTestRunner(out_dir)
archive_build_conf(out_dir)
- ret = runner.run_tests()
- if not ret:
+ runner = BuildPerfTestRunner(out_dir, verbosity=2)
+ result = runner.run(suite)
+ if result.wasSuccessful():
if args.globalres_file:
- runner.update_globalres_file(args.globalres_file)
+ result.update_globalres_file(args.globalres_file)
+ return 0
- return ret
+ return 1
if __name__ == '__main__':
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list