Add focused tests for native MSVC host and tool architecture checks

Open Beginner friendly
#672 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Start with tools/test_check_msvc_native.py and tools/check_msvc_native.py, especially require_native and the existing environment and PE parsing tests. Run python3 -m unittest tools.test_check_msvc_native on a non-Windows host, then add focused mocked cases for each acceptance and rejection decision. Done means the tests distinguish each failure reason without SDK, PE executables, or compilation.

Written by the indexing model from the issue text.

Description

ci enhancement good first issue

Coverage gap

require_native is the gate preventing emulated/wrong-machine execution from counting as native MSVC validation. It checks IsWow64Process2, the wavec/clang PE machine fields, and required SDK environment variables.

On master 0c32b946, the current tests cover an unavailable environment and PE header parsing, but do not independently exercise these acceptance/rejection decisions. On Linux, the unavailable-environment test exits at the os.name guard before reaching them. This is a test-coverage task, not a claim that the existing native check accepts emulation.

Scope

Difficulty: easy. Add table-driven unit tests around this small function using mocked Windows API results, PE inspection and environment variables. Use lightweight fakes or a narrow injectable helper if needed; avoid replacing global platform state in a way that makes pathlib choose an unsupported WindowsPath on Linux.

Cover:

  • Native x64 and native ARM64 success with matching compiler/clang machines and SDK variables.
  • Nonzero process-machine result (emulation) rejection.
  • Host-machine mismatch rejection.
  • Wrong wavec machine and wrong clang machine, checked independently.
  • Missing/empty LIB and INCLUDE, independently.
  • Windows API failure reported as a failure with useful cause.

Acceptance

python3 -m unittest tools.test_check_msvc_native runs the tests on a non-Windows development host with no real SDK/PE executables or subprocess compilation. Assertions distinguish the relevant rejection reason; do not merely assert that some exception occurred. Keep the production requirement for real native Windows execution unchanged.

This covers prerequisite decision logic only. Scenario timeout/report handling and package dependency inspection (#622) are separate tasks.

Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 6m
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wavefnd/Wave

All issues in wavefnd/Wave

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.