diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 10 |
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 | |||
22 | from oeqa.utils.commands import runCmd, get_bb_vars, get_test_layer | 22 | from oeqa.utils.commands import runCmd, get_bb_vars, get_test_layer |
23 | 23 | ||
24 | class OESelftestTestContext(OETestContext): | 24 | class OESelftestTestContext(OETestContext): |
25 | def __init__(self, td=None, logger=None, machines=None, config_paths=None): | 25 | def __init__(self, td=None, logger=None, machines=None, config_paths=None, newbuilddir=None): |
26 | super(OESelftestTestContext, self).__init__(td, logger) | 26 | super(OESelftestTestContext, self).__init__(td, logger) |
27 | 27 | ||
28 | self.machines = machines | 28 | self.machines = machines |
29 | self.custommachine = None | 29 | self.custommachine = None |
30 | self.config_paths = config_paths | 30 | self.config_paths = config_paths |
31 | self.newbuilddir = newbuilddir | ||
31 | 32 | ||
32 | def setup_builddir(self, suffix, selftestdir, suite): | 33 | def setup_builddir(self, suffix, selftestdir, suite): |
33 | builddir = os.environ['BUILDDIR'] | 34 | builddir = os.environ['BUILDDIR'] |
34 | if not selftestdir: | 35 | if not selftestdir: |
35 | selftestdir = get_test_layer() | 36 | selftestdir = get_test_layer() |
36 | newbuilddir = builddir + suffix | 37 | if self.newbuilddir: |
38 | newbuilddir = os.path.join(self.newbuilddir, 'build' + suffix) | ||
39 | else: | ||
40 | newbuilddir = builddir + suffix | ||
37 | newselftestdir = newbuilddir + "/meta-selftest" | 41 | newselftestdir = newbuilddir + "/meta-selftest" |
38 | 42 | ||
39 | if os.path.exists(newbuilddir): | 43 | if os.path.exists(newbuilddir): |
@@ -133,6 +137,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
133 | action='append', default=None, | 137 | action='append', default=None, |
134 | help='Exclude all (unhidden) tests that match any of the specified tag(s). (exclude applies before select)') | 138 | help='Exclude all (unhidden) tests that match any of the specified tag(s). (exclude applies before select)') |
135 | 139 | ||
140 | parser.add_argument('-B', '--newbuilddir', help='New build directory to use for tests.') | ||
136 | parser.set_defaults(func=self.run) | 141 | parser.set_defaults(func=self.run) |
137 | 142 | ||
138 | def _get_available_machines(self): | 143 | def _get_available_machines(self): |
@@ -187,6 +192,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
187 | self.tc_kwargs['init']['config_paths']['builddir'] = builddir | 192 | self.tc_kwargs['init']['config_paths']['builddir'] = builddir |
188 | self.tc_kwargs['init']['config_paths']['localconf'] = os.path.join(builddir, "conf/local.conf") | 193 | self.tc_kwargs['init']['config_paths']['localconf'] = os.path.join(builddir, "conf/local.conf") |
189 | self.tc_kwargs['init']['config_paths']['bblayers'] = os.path.join(builddir, "conf/bblayers.conf") | 194 | self.tc_kwargs['init']['config_paths']['bblayers'] = os.path.join(builddir, "conf/bblayers.conf") |
195 | self.tc_kwargs['init']['newbuilddir'] = args.newbuilddir | ||
190 | 196 | ||
191 | def tag_filter(tags): | 197 | def tag_filter(tags): |
192 | if args.exclude_tags: | 198 | if args.exclude_tags: |