summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Barker <pbarker@konsulko.com>2020-06-03 21:07:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-04 13:21:01 +0100
commitdab719e5f1964fd48e9a35e6b9db1508b5414540 (patch)
tree58bbf37441864adb6d35f92d967a0e8dcbaea297 /meta
parent23df3024664ec56dbbe8865ef3953d2c33a7a2cb (diff)
downloadopenembedded-core-dab719e5f1964fd48e9a35e6b9db1508b5414540.tar.gz
oe-selftest: Allow overriding the build directory used for tests
This may be useful if the parent directory of the original builddir is not writable, on a lower performance drive, etc. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/context.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index 48ec5d419c..17f2a0cf6b 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -22,18 +22,22 @@ from oeqa.core.exception import OEQAPreRun, OEQATestNotFound
from oeqa.utils.commands import runCmd, get_bb_vars, get_test_layer
class OESelftestTestContext(OETestContext):
- def __init__(self, td=None, logger=None, machines=None, config_paths=None):
+ def __init__(self, td=None, logger=None, machines=None, config_paths=None, newbuilddir=None):
super(OESelftestTestContext, self).__init__(td, logger)
self.machines = machines
self.custommachine = None
self.config_paths = config_paths
+ self.newbuilddir = newbuilddir
def setup_builddir(self, suffix, selftestdir, suite):
builddir = os.environ['BUILDDIR']
if not selftestdir:
selftestdir = get_test_layer()
- newbuilddir = builddir + suffix
+ if self.newbuilddir:
+ newbuilddir = os.path.join(self.newbuilddir, 'build' + suffix)
+ else:
+ newbuilddir = builddir + suffix
newselftestdir = newbuilddir + "/meta-selftest"
if os.path.exists(newbuilddir):
@@ -133,6 +137,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor):
action='append', default=None,
help='Exclude all (unhidden) tests that match any of the specified tag(s). (exclude applies before select)')
+ parser.add_argument('-B', '--newbuilddir', help='New build directory to use for tests.')
parser.set_defaults(func=self.run)
def _get_available_machines(self):
@@ -187,6 +192,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor):
self.tc_kwargs['init']['config_paths']['builddir'] = builddir
self.tc_kwargs['init']['config_paths']['localconf'] = os.path.join(builddir, "conf/local.conf")
self.tc_kwargs['init']['config_paths']['bblayers'] = os.path.join(builddir, "conf/bblayers.conf")
+ self.tc_kwargs['init']['newbuilddir'] = args.newbuilddir
def tag_filter(tags):
if args.exclude_tags: