---
id: TASK-37
title: Add cmd coverage tests for menuconfig/bom/run success paths
status: Done
assignee:
  - codex
created_date: '2026-03-04 22:30'
updated_date: '2026-03-04 22:40'
labels: []
dependencies: []
references:
  - src/core/cmd.rs
  - /tmp/coverage.txt
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Coverage report shows uncovered lines in `src/core/cmd.rs` for menuconfig/bom/run success flows (sysbuild image resolution, bom init/config, and run paths). Add dry-run unit tests to exercise these code paths without running external tools.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Add a `cmd_menuconfig` test that sets `sysbuild=true`, provides an image, and uses `Runner { dry_run: true }` to cover the sysbuild branch and command construction.
- [x] #2 Add a `cmd_bom` test that sets `bom_build=true`, uses `Runner { dry_run: true }`, and covers the sysbuild image resolution + command invocation path.
- [x] #3 Add a `cmd_run` test that sets `norebuild=true` and provides a fake `zephyr/zephyr` binary in a temp build dir to cover the direct run branch without invoking `ninja` (use dry_run runner).
- [x] #4 Tests live in `src/core/cmd.rs` and pass under `just check`.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1) Add a cmd_menuconfig test in src/core/cmd.rs that sets sysbuild=true, provides a valid image dir, and uses Runner { dry_run: true } to cover the sysbuild path.
2) Add a cmd_bom test that sets bom_build=true, sysbuild=true, and uses Runner { dry_run: true } with a temp image dir to cover sysbuild image resolution and command path.
3) Add a cmd_run test that sets norebuild=true, creates a fake zephyr/zephyr file in the build dir, and uses Runner { dry_run: true } to cover the direct-run branch.
4) Run just check to confirm.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Added cmd_menuconfig/cmd_bom sysbuild dry-run tests and a cmd_run direct-zephyr binary test with norebuild. Ran `just check -- -D warnings` (passes).
<!-- SECTION:NOTES:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added cmd coverage tests for menuconfig/bom sysbuild paths (dry-run) and direct zephyr run path with norebuild. Tests: `just check -- -D warnings`.
<!-- SECTION:FINAL_SUMMARY:END -->
