summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/bsp/BoardPresets.json4
-rwxr-xr-xtest/hil/hil_test.py14
-rwxr-xr-xtools/gen_presets.py4
3 files changed, 16 insertions, 6 deletions
diff --git a/hw/bsp/BoardPresets.json b/hw/bsp/BoardPresets.json
index a700e7309..09a9ef18f 100644
--- a/hw/bsp/BoardPresets.json
+++ b/hw/bsp/BoardPresets.json
@@ -5,10 +5,10 @@
"name": "default",
"hidden": true,
"description": "Configure preset for the ${presetName} board",
- "generator": "Ninja",
+ "generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/cmake-build-${presetName}",
"cacheVariables": {
- "CMAKE_BUILD_TYPE": "RelWithDebInfo",
+ "CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
"BOARD": "${presetName}"
}
},
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'
diff --git a/tools/gen_presets.py b/tools/gen_presets.py
index 60404a5a7..6f32976a7 100755
--- a/tools/gen_presets.py
+++ b/tools/gen_presets.py
@@ -31,10 +31,10 @@ def main():
{"name": "default",
"hidden": True,
"description": r"Configure preset for the ${presetName} board",
- "generator": "Ninja",
+ "generator": "Ninja Multi-Config",
"binaryDir": r"${sourceDir}/cmake-build-${presetName}",
"cacheVariables": {
- "CMAKE_BUILD_TYPE": "RelWithDebInfo",
+ "CMAKE_DEFAULT_BUILD_TYPE": "RelWithDebInfo",
"BOARD": r"${presetName}"
}},
{"name": "default single config",