twister: Convert platform names before printing

Just move a code with workaroud to convert platform names
to the full name with variants.
It fixes an issue, that not every platforms are printed
before running tests.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This commit is contained in:
Grzegorz Chwierut 2025-05-23 17:26:04 +02:00 committed by Benjamin Cabé
commit 632d006260

View file

@ -135,6 +135,16 @@ def twister(options: argparse.Namespace, default_options: argparse.Namespace):
report.synopsis()
return 0
# FIXME: This is a workaround for the fact that the hardware map can be usng
# the short name of the platform, while the testplan is using the full name.
#
# convert platform names coming from the hardware map to the full target
# name.
# this is needed to match the platform names in the testplan.
for d in hwm.duts:
if d.platform in tplan.platform_names:
d.platform = tplan.get_platform(d.platform).name
if options.device_testing and not options.build_only:
print("\nDevice testing on:")
hwm.dump(filtered=tplan.selected_platforms)
@ -149,15 +159,6 @@ def twister(options: argparse.Namespace, default_options: argparse.Namespace):
tplan.create_build_dir_links()
runner = TwisterRunner(tplan.instances, tplan.testsuites, env)
# FIXME: This is a workaround for the fact that the hardware map can be usng
# the short name of the platform, while the testplan is using the full name.
#
# convert platform names coming from the hardware map to the full target
# name.
# this is needed to match the platform names in the testplan.
for d in hwm.duts:
if d.platform in tplan.platform_names:
d.platform = tplan.get_platform(d.platform).name
runner.duts = hwm.duts
runner.run()