diff options
| author | hathach <[email protected]> | 2026-06-08 15:42:00 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-06-08 15:42:00 +0700 |
| commit | 46aded44af947e1be32426edcd6ff2c0596f1765 (patch) | |
| tree | 6773f45dff25011e3b1d228e4c2fdedec42a479a /test | |
| parent | d38ba79ad4a9cd90589a422b6eebd90614af4008 (diff) | |
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) <[email protected]>
Diffstat (limited to 'test')
| -rwxr-xr-x | test/hil/hil_test.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 2fb5f6b3f..2758d093c 100755 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -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' |
