mirror of
https://github.com/hathach/tinyusb.git
synced 2026-08-18 11:02:16 +00:00
presets,hil: keep Ninja Multi-Config; make HIL find its output
Per review (HiFiPhile): Ninja Multi-Config is needed for IAR, otherwise the optimization level can't be lowered to none for debug. Revert gen_presets.py back to Ninja Multi-Config (keeping only the cmake-build-<board> binaryDir change), and instead teach hil_test.py to locate <ex>.elf whether it sits directly in the example dir (single-config) or under a per-config subdir like RelWithDebInfo/ (multi-config). Verified: stm32u083nucleo passes 13/13 remote HIL with a multi-config preset build (rsync preserves the RelWithDebInfo/ subdir; the resolver finds it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -1516,10 +1516,20 @@ def test_example(board: Board, f1: str, example: str) -> tuple[int, str]:
|
||||
f1_str = f1_suffix(f1)
|
||||
|
||||
fw_dir = TINYUSB_ROOT / build_dir / f'cmake-build-{name}{f1_str}' / example
|
||||
fw_name = fw_dir / Path(example).name
|
||||
base = Path(example).name
|
||||
test_name = f'{name+f1_str:40} {example:30} ...'
|
||||
|
||||
if not fw_dir.exists() or not ((fw_name.with_suffix('.elf')).exists() or (fw_name.with_suffix('.bin')).exists()):
|
||||
# firmware sits directly in the example dir (single-config Ninja) or under a
|
||||
# per-config subdir like RelWithDebInfo/ (Ninja Multi-Config); accept either.
|
||||
fw_name = None
|
||||
if fw_dir.is_dir():
|
||||
for cand in [fw_dir / base, fw_dir / 'RelWithDebInfo' / base,
|
||||
*(p.with_suffix('') for p in sorted(fw_dir.glob(f'*/{base}.elf')))]:
|
||||
if cand.with_suffix('.elf').exists() or cand.with_suffix('.bin').exists():
|
||||
fw_name = cand
|
||||
break
|
||||
|
||||
if fw_name is None:
|
||||
log_line(f'{test_name} Skip (no binary)')
|
||||
return 0, 'skip'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user