sanitycheck: support for multiple toolchain

Added support for multiple toolchain usage.
Every arch contains a list of supported toolchain.
Each board can override the supported toolchain list.
If the board is not supported in the current toolchain,
will be discarded.

The current toolchain is defined by ZEPHYR_GCC_VARIANT.
Added support for toolchain ISSM and ZEPHYR.

Change-Id: I31e9b39ba01f6e9bdc4557702428cd09e05f492a
Jira: ZEP-592
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
This commit is contained in:
Javier B Perez 2016-08-15 13:25:33 -05:00 committed by Andrew Boie
commit 4b554baa87
5 changed files with 22 additions and 4 deletions

View file

@ -1,3 +1,4 @@
[arch] [arch]
name = arc name = arc
platforms = arduino_101_sss quark_se_sss_devboard em_starterkit platforms = arduino_101_sss quark_se_sss_devboard em_starterkit
supported_toolchains = issm zephyr

View file

@ -2,6 +2,7 @@
name = arm name = arm
platforms = qemu_cortex_m3 frdm_k64f arduino_due nucleo_f103rb stm32_mini_a15 platforms = qemu_cortex_m3 frdm_k64f arduino_due nucleo_f103rb stm32_mini_a15
olimexino_stm32 nrf52_nitrogen nrf52_pca10040 olimexino_stm32 nrf52_nitrogen nrf52_pca10040
supported_toolchains = zephyr
[qemu_cortex_m3] [qemu_cortex_m3]
qemu_support = true qemu_support = true

View file

@ -1,6 +1,7 @@
[arch] [arch]
name = nios2 name = nios2
platforms = qemu_nios2 altera_max10 platforms = qemu_nios2 altera_max10
supported_toolchains = zephyr
[qemu_nios2] [qemu_nios2]
qemu_support = true qemu_support = true

View file

@ -1,6 +1,7 @@
[arch] [arch]
name = x86 name = x86
platforms = qemu_x86_iamcu arduino_101 qemu_x86 minnowboard galileo quark_d2000_crb quark_se_devboard platforms = qemu_x86_iamcu arduino_101 qemu_x86 minnowboard galileo quark_d2000_crb quark_se_devboard
supported_toolchains = zephyr
[qemu_x86] [qemu_x86]
qemu_support = true qemu_support = true
@ -17,9 +18,12 @@ qemu_support = false
[quark_d2000_crb] [quark_d2000_crb]
qemu_support = false qemu_support = false
microkernel_support = false microkernel_support = false
supported_toolchains = issm zephyr
[arduino_101] [arduino_101]
qemu_support = false qemu_support = false
supported_toolchains = issm zephyr
[quark_se_devboard] [quark_se_devboard]
qemu_support = false qemu_support = false
supported_toolchains = issm zephyr

View file

@ -801,11 +801,13 @@ class MakeGenerator:
# XXX Be sure to update __doc__ if you change any of this!! # XXX Be sure to update __doc__ if you change any of this!!
arch_valid_keys = {"name" : {"type" : "str", "required" : True}, arch_valid_keys = {"name" : {"type" : "str", "required" : True},
"platforms" : {"type" : "list", "required" : True}} "platforms" : {"type" : "list", "required" : True},
"supported_toolchains" : {"type" : "list", "required" : True}}
platform_valid_keys = {"qemu_support" : {"type" : "bool", "default" : False}, platform_valid_keys = {"qemu_support" : {"type" : "bool", "default" : False},
"microkernel_support" : {"type" : "bool", "microkernel_support" : {"type" : "bool",
"default" : True}} "default" : True},
"supported_toolchains" : {"type" : "list", "default" : []}}
testcase_valid_keys = {"tags" : {"type" : "set", "required" : True}, testcase_valid_keys = {"tags" : {"type" : "set", "required" : True},
"extra_args" : {"type" : "list"}, "extra_args" : {"type" : "list"},
@ -962,6 +964,9 @@ class Platform:
self.qemu_support = plat_dict["qemu_support"] self.qemu_support = plat_dict["qemu_support"]
self.microkernel_support = plat_dict["microkernel_support"] self.microkernel_support = plat_dict["microkernel_support"]
self.arch = arch self.arch = arch
self.supported_toolchains = arch.supported_toolchains
if plat_dict["supported_toolchains"]:
self.supported_toolchains = plat_dict["supported_toolchains"]
# Gets populated in a separate step # Gets populated in a separate step
self.defconfig = {"micro" : None, "nano" : None} self.defconfig = {"micro" : None, "nano" : None}
pass pass
@ -1011,6 +1016,7 @@ class Architecture:
arch = cp.get_section("arch", arch_valid_keys) arch = cp.get_section("arch", arch_valid_keys)
self.name = arch["name"] self.name = arch["name"]
self.supported_toolchains = arch["supported_toolchains"]
for plat_name in arch["platforms"]: for plat_name in arch["platforms"]:
verbose("Platform: %s" % plat_name) verbose("Platform: %s" % plat_name)
@ -1203,7 +1209,7 @@ class TestSuite:
def apply_filters(self, platform_filter, arch_filter, tag_filter, def apply_filters(self, platform_filter, arch_filter, tag_filter,
config_filter, testcase_filter, last_failed, all_plats, config_filter, testcase_filter, last_failed, all_plats,
platform_limit): platform_limit, toolchain):
instances = [] instances = []
discards = {} discards = {}
verbose("platform filter: " + str(platform_filter)) verbose("platform filter: " + str(platform_filter))
@ -1349,6 +1355,10 @@ class TestSuite:
discards[instance] = "No microkernel support for platform" discards[instance] = "No microkernel support for platform"
continue continue
if toolchain and toolchain not in plat.supported_toolchains:
discards[instance] = "Not supported by the toolchain"
continue
defconfig = {"ARCH" : arch.name, "PLATFORM" : plat.name} defconfig = {"ARCH" : arch.name, "PLATFORM" : plat.name}
defconfig.update(os.environ) defconfig.update(os.environ)
for tcase, tdefconfig in tc.defconfig.items(): for tcase, tdefconfig in tc.defconfig.items():
@ -1688,6 +1698,7 @@ def main():
start_time = time.time() start_time = time.time()
global VERBOSE, INLINE_LOGS, CPU_COUNTS global VERBOSE, INLINE_LOGS, CPU_COUNTS
args = parse_arguments() args = parse_arguments()
toolchain = os.environ.get("ZEPHYR_GCC_VARIANT", None)
if args.size: if args.size:
for fn in args.size: for fn in args.size:
@ -1710,7 +1721,7 @@ def main():
ts = TestSuite(args.arch_root, args.testcase_root, args.outdir) ts = TestSuite(args.arch_root, args.testcase_root, args.outdir)
discards = ts.apply_filters(args.platform, args.arch, args.tag, args.config, discards = ts.apply_filters(args.platform, args.arch, args.tag, args.config,
args.test, args.only_failed, args.all, args.test, args.only_failed, args.all,
args.platform_limit) args.platform_limit, toolchain)
if args.discard_report: if args.discard_report:
ts.discard_report(args.discard_report) ts.discard_report(args.discard_report)