twister: raise error for non-existing platform call

Changes will raise error and break program in following three situations:

1. Platform name pass in --platform option does not exist.
2. During using --all option, platform from platform_allow list does not
exist.
3. During using --integration option, platform from
integration_platforms list does not exist.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
This commit is contained in:
Piotr Golyzniak 2022-01-10 14:15:59 +01:00 committed by Anas Nashif
commit 483101fe36
3 changed files with 7 additions and 1 deletions

View file

@ -3867,13 +3867,14 @@ class TestSuite(DisablePyTestCollectionMixin):
"""
Verify if platform name (passed by --platform option, or in yaml file
as platform_allow or integration_platforms options) is correct. If not -
log error.
log and raise error.
"""
for platform in platform_names_to_verify:
if platform in self.platform_names:
break
else:
logger.error(f"{log_info} - unrecognized platform - {platform}")
sys.exit(2)
class CoverageTool: