sanitycheck: add toolchain keyword to testcases

Some testcases can only be built with certain toolchains. Instead of
using filters, add support for toolchain keyword which enables
whitelisting and exclusion.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-06-27 18:05:30 -04:00 committed by Kumar Gala
commit b17e1caf0a

View file

@ -928,6 +928,8 @@ testcase_valid_keys = {"tags" : {"type" : "set", "required" : True},
"extra_sections" : {"type" : "list", "default" : []},
"platform_exclude" : {"type" : "set"},
"platform_whitelist" : {"type" : "set"},
"toolchain_exclude" : {"type" : "set"},
"toolchain_whitelist" : {"type" : "set"},
"filter" : {"type" : "str"}}
@ -1136,6 +1138,8 @@ class TestCase:
self.skip = tc_dict["skip"]
self.platform_exclude = tc_dict["platform_exclude"]
self.platform_whitelist = tc_dict["platform_whitelist"]
self.toolchain_exclude = tc_dict["toolchain_exclude"]
self.toolchain_whitelist = tc_dict["toolchain_whitelist"]
self.tc_filter = tc_dict["filter"]
self.timeout = tc_dict["timeout"]
self.build_only = tc_dict["build_only"]
@ -1347,6 +1351,9 @@ class TestSuite:
if tc.platform_exclude and plat.name in tc.platform_exclude:
continue
if tc.toolchain_exclude and toolchain in tc.toolchain_exclude:
continue
if platform_filter and plat.name not in platform_filter:
continue
@ -1365,6 +1372,9 @@ class TestSuite:
if tc.platform_whitelist and plat.name not in tc.platform_whitelist:
continue
if tc.toolchain_whitelist and toolchain not in tc.toolchain_whitelist:
continue
if (tc.tc_filter and (plat.default or all_plats or platform_filter) and
toolchain in plat.supported_toolchains):
args = tc.extra_args[:]
@ -1451,6 +1461,10 @@ class TestSuite:
discards[instance] = "In test case platform exclude"
continue
if tc.toolchain_exclude and toolchain in tc.toolchain_exclude:
discards[instance] = "In test case toolchain exclude"
continue
if platform_filter and plat.name not in platform_filter:
discards[instance] = "Command line platform filter"
continue
@ -1459,6 +1473,10 @@ class TestSuite:
discards[instance] = "Not in testcase platform whitelist"
continue
if tc.toolchain_whitelist and toolchain not in tc.toolchain_whitelist:
discards[instance] = "Not in testcase toolchain whitelist"
continue
if toolchain and toolchain not in plat.supported_toolchains:
discards[instance] = "Not supported by the toolchain"
continue