mirror of
https://git.yoctoproject.org/poky
synced 2026-04-30 12:32:12 +02:00
oeqa/core: Add a check for MACHINE
(From OE-Core rev: e69f963e548e2f6f211a56406694c029111d7203) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5c9e840dae
commit
1351614b8d
@@ -18,6 +18,16 @@ def has_feature(td, feature):
|
||||
return True
|
||||
return False
|
||||
|
||||
def has_machine(td, machine):
|
||||
"""
|
||||
Checks for MACHINE.
|
||||
"""
|
||||
|
||||
if (machine in td.get('MACHINE', '')):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@registerDecorator
|
||||
class skipIfDataVar(OETestDecorator):
|
||||
"""
|
||||
@@ -131,3 +141,37 @@ class skipIfFeature(OETestDecorator):
|
||||
self.logger.debug(msg)
|
||||
if has_feature(self.case.td, self.value):
|
||||
self.case.skipTest(self.msg)
|
||||
|
||||
@registerDecorator
|
||||
class skipIfNotMachine(OETestDecorator):
|
||||
"""
|
||||
Skip test based on MACHINE.
|
||||
|
||||
value must be match MACHINE or it will skip the test
|
||||
with msg as the reason.
|
||||
"""
|
||||
|
||||
attrs = ('value', 'msg')
|
||||
|
||||
def setUpDecorator(self):
|
||||
msg = ('Checking if %s is not this MACHINE' % self.value)
|
||||
self.logger.debug(msg)
|
||||
if not has_machine(self.case.td, self.value):
|
||||
self.case.skipTest(self.msg)
|
||||
|
||||
@registerDecorator
|
||||
class skipIfMachine(OETestDecorator):
|
||||
"""
|
||||
Skip test based on Machine.
|
||||
|
||||
value must not be this machine or it will skip the test
|
||||
with msg as the reason.
|
||||
"""
|
||||
|
||||
attrs = ('value', 'msg')
|
||||
|
||||
def setUpDecorator(self):
|
||||
msg = ('Checking if %s is this MACHINE' % self.value)
|
||||
self.logger.debug(msg)
|
||||
if has_machine(self.case.td, self.value):
|
||||
self.case.skipTest(self.msg)
|
||||
|
||||
Reference in New Issue
Block a user