scripts: west_commands: build: Fix empty testcase

An empty but specified testcase does not build, check if the test key
exists instead.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-08-01 11:24:17 +02:00 committed by Carles Cufí
parent bb4af13da0
commit 9894b84a2d
1 changed files with 2 additions and 2 deletions

View File

@ -294,9 +294,9 @@ class Build(Forceable):
tests = y.get('tests')
if not tests:
log.die(f"No tests found in {yf}")
item = tests.get(test_item)
if not item:
if test_item not in tests:
log.die(f"Test item {test_item} not found in {yf}")
item = tests.get(test_item)
sysbuild = False
extra_dtc_overlay_files = []