sanitychecks: add new keyword 'kernel' to testcase.ini
Specify the kernel being tested instead of relying on parsing Makefile for KERNEL_TYPE. This is needed for testcases that build for multiple kernels. Change-Id: Ic4df2fa66eee4cd498955aee2b0da80a99d35e30 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
d93cb67109
commit
a7c4aa2e8a
1 changed files with 19 additions and 10 deletions
|
@ -30,6 +30,10 @@ Each testcase.ini block can define the following key/value pairs:
|
||||||
run under certain circumstances, like daily builds. These test cases
|
run under certain circumstances, like daily builds. These test cases
|
||||||
are still compiled.
|
are still compiled.
|
||||||
|
|
||||||
|
kernel = <nano|micro>
|
||||||
|
Specify the kernel being tested instead of relying on parsing
|
||||||
|
Makefile for KERNEL_TYPE
|
||||||
|
|
||||||
extra_args = <list of extra arguments>
|
extra_args = <list of extra arguments>
|
||||||
Extra arguments to pass to Make when building or running the
|
Extra arguments to pass to Make when building or running the
|
||||||
test case.
|
test case.
|
||||||
|
@ -725,6 +729,7 @@ testcase_valid_keys = {"tags" : {"type" : "set", "required" : True},
|
||||||
"skip" : {"type" : "bool", "default" : False},
|
"skip" : {"type" : "bool", "default" : False},
|
||||||
"slow" : {"type" : "bool", "default" : False},
|
"slow" : {"type" : "bool", "default" : False},
|
||||||
"timeout" : {"type" : "int", "default" : 60},
|
"timeout" : {"type" : "int", "default" : 60},
|
||||||
|
"kernel" : {"type": "str", "required" : False},
|
||||||
"arch_whitelist" : {"type" : "set"},
|
"arch_whitelist" : {"type" : "set"},
|
||||||
"arch_exclude" : {"type" : "set"},
|
"arch_exclude" : {"type" : "set"},
|
||||||
"platform_exclude" : {"type" : "set"},
|
"platform_exclude" : {"type" : "set"},
|
||||||
|
@ -968,6 +973,7 @@ class TestCase:
|
||||||
self.arch_whitelist = tc_dict["arch_whitelist"]
|
self.arch_whitelist = tc_dict["arch_whitelist"]
|
||||||
self.arch_exclude = tc_dict["arch_exclude"]
|
self.arch_exclude = tc_dict["arch_exclude"]
|
||||||
self.skip = tc_dict["skip"]
|
self.skip = tc_dict["skip"]
|
||||||
|
self.kernel = tc_dict["kernel"]
|
||||||
self.platform_exclude = tc_dict["platform_exclude"]
|
self.platform_exclude = tc_dict["platform_exclude"]
|
||||||
self.platform_whitelist = tc_dict["platform_whitelist"]
|
self.platform_whitelist = tc_dict["platform_whitelist"]
|
||||||
self.config_whitelist = tc_dict["config_whitelist"]
|
self.config_whitelist = tc_dict["config_whitelist"]
|
||||||
|
@ -976,18 +982,21 @@ class TestCase:
|
||||||
self.slow = tc_dict["slow"]
|
self.slow = tc_dict["slow"]
|
||||||
self.path = os.path.join(workdir, name)
|
self.path = os.path.join(workdir, name)
|
||||||
self.name = self.path # for now
|
self.name = self.path # for now
|
||||||
self.ktype = None
|
|
||||||
self.defconfig = {}
|
self.defconfig = {}
|
||||||
|
self.ktype = None
|
||||||
|
|
||||||
with open(os.path.join(testcase_root, workdir, "Makefile")) as makefile:
|
if self.kernel:
|
||||||
for line in makefile.readlines():
|
self.ktype = self.kernel
|
||||||
m = TestCase.makefile_re.match(line)
|
else:
|
||||||
if m:
|
with open(os.path.join(testcase_root, workdir, "Makefile")) as makefile:
|
||||||
self.ktype = m.group(1)
|
for line in makefile.readlines():
|
||||||
break
|
m = TestCase.makefile_re.match(line)
|
||||||
if not self.ktype:
|
if m:
|
||||||
raise ConfigurationError(os.path.join(workdir, "Makefile"),
|
self.ktype = m.group(1)
|
||||||
"KERNEL_TYPE not found")
|
break
|
||||||
|
if not self.ktype:
|
||||||
|
raise ConfigurationError(os.path.join(workdir, "Makefile"),
|
||||||
|
"KERNEL_TYPE not found")
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue