diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/context.py')
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 990c761f29..9e90d3c256 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
@@ -25,14 +25,14 @@ class OESelftestTestContext(OETestContext): | |||
25 | self.custommachine = None | 25 | self.custommachine = None |
26 | self.config_paths = config_paths | 26 | self.config_paths = config_paths |
27 | 27 | ||
28 | def runTests(self, machine=None): | 28 | def runTests(self, machine=None, skips=[]): |
29 | if machine: | 29 | if machine: |
30 | self.custommachine = machine | 30 | self.custommachine = machine |
31 | if machine == 'random': | 31 | if machine == 'random': |
32 | self.custommachine = choice(self.machines) | 32 | self.custommachine = choice(self.machines) |
33 | self.logger.info('Run tests with custom MACHINE set to: %s' % \ | 33 | self.logger.info('Run tests with custom MACHINE set to: %s' % \ |
34 | self.custommachine) | 34 | self.custommachine) |
35 | return super(OESelftestTestContext, self).runTests() | 35 | return super(OESelftestTestContext, self).runTests(skips) |
36 | 36 | ||
37 | def listTests(self, display_type, machine=None): | 37 | def listTests(self, display_type, machine=None): |
38 | return super(OESelftestTestContext, self).listTests(display_type) | 38 | return super(OESelftestTestContext, self).listTests(display_type) |
@@ -51,6 +51,9 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
51 | group.add_argument('-a', '--run-all-tests', default=False, | 51 | group.add_argument('-a', '--run-all-tests', default=False, |
52 | action="store_true", dest="run_all_tests", | 52 | action="store_true", dest="run_all_tests", |
53 | help='Run all (unhidden) tests') | 53 | help='Run all (unhidden) tests') |
54 | group.add_argument('-R', '--skip-tests', required=False, action='store', | ||
55 | nargs='+', dest="skips", default=None, | ||
56 | help='Run all (unhidden) tests except the ones specified. Format should be <module>[.<class>[.<test_method>]]') | ||
54 | group.add_argument('-r', '--run-tests', required=False, action='store', | 57 | group.add_argument('-r', '--run-tests', required=False, action='store', |
55 | nargs='+', dest="run_tests", default=None, | 58 | nargs='+', dest="run_tests", default=None, |
56 | help='Select what tests to run (modules, classes or test methods). Format should be: <module>.<class>.<test_method>') | 59 | help='Select what tests to run (modules, classes or test methods). Format should be: <module>.<class>.<test_method>') |
@@ -133,6 +136,8 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
133 | copyfile(self.tc_kwargs['init']['config_paths']['bblayers'], | 136 | copyfile(self.tc_kwargs['init']['config_paths']['bblayers'], |
134 | self.tc_kwargs['init']['config_paths']['bblayers_backup']) | 137 | self.tc_kwargs['init']['config_paths']['bblayers_backup']) |
135 | 138 | ||
139 | self.tc_kwargs['run']['skips'] = args.skips | ||
140 | |||
136 | def _pre_run(self): | 141 | def _pre_run(self): |
137 | def _check_required_env_variables(vars): | 142 | def _check_required_env_variables(vars): |
138 | for var in vars: | 143 | for var in vars: |
@@ -203,7 +208,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): | |||
203 | sys.exit(1) | 208 | sys.exit(1) |
204 | 209 | ||
205 | if args.list_tests: | 210 | if args.list_tests: |
206 | rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['run']) | 211 | rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['list']) |
207 | else: | 212 | else: |
208 | self._pre_run() | 213 | self._pre_run() |
209 | rc = self.tc.runTests(**self.tc_kwargs['run']) | 214 | rc = self.tc.runTests(**self.tc_kwargs['run']) |