diff --git a/scripts/pylib/twister/twisterlib/platform.py b/scripts/pylib/twister/twisterlib/platform.py index fbb6b915c2d..a74a2b61b9f 100644 --- a/scripts/pylib/twister/twisterlib/platform.py +++ b/scripts/pylib/twister/twisterlib/platform.py @@ -58,6 +58,7 @@ class Platform: self.ignore_tags = testing.get("ignore_tags", []) self.only_tags = testing.get("only_tags", []) self.default = testing.get("default", False) + self.binaries = testing.get("binaries", []) # if no flash size is specified by the board, take a default of 512K self.flash = data.get("flash", 512) self.supported = set() diff --git a/scripts/pylib/twister/twisterlib/runner.py b/scripts/pylib/twister/twisterlib/runner.py index 57a4a3a553d..4c8e284331d 100644 --- a/scripts/pylib/twister/twisterlib/runner.py +++ b/scripts/pylib/twister/twisterlib/runner.py @@ -673,11 +673,17 @@ class ProjectBuilder(FilterBuilder): 'CMakeCache.txt', os.path.join('zephyr', 'runners.yaml'), ] - keep = [ - os.path.join('zephyr', 'zephyr.hex'), - os.path.join('zephyr', 'zephyr.bin'), - os.path.join('zephyr', 'zephyr.elf'), - ] + platform = self.instance.platform + if platform.binaries: + keep = [] + for binary in platform.binaries: + keep.append(os.path.join('zephyr', binary )) + else: + keep = [ + os.path.join('zephyr', 'zephyr.hex'), + os.path.join('zephyr', 'zephyr.bin'), + os.path.join('zephyr', 'zephyr.elf'), + ] keep += sanitizelist diff --git a/scripts/schemas/twister/platform-schema.yaml b/scripts/schemas/twister/platform-schema.yaml index 5af6ad25e3d..6e94218e69b 100644 --- a/scripts/schemas/twister/platform-schema.yaml +++ b/scripts/schemas/twister/platform-schema.yaml @@ -55,11 +55,14 @@ mapping: required: false "default": type: bool + "binaries": + type: seq + seq: + - type: str "only_tags": type: seq seq: - - - type: str + - type: str "ignore_tags": type: seq seq: