Repository navigation
regen_fixtures: reject unknown options before writing - #7609
Barbital11111 wants to merge 1 commit into
Conversation
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
Independent Windows CPU verification at a735c9c5a91846566723a53fc6c1081efed85f61.
Environment & Test Suite
- Platform: Native Windows 11 x64, Python 3.12 / 3.13, CPU-only.
- Clean-room: Pure synthetic test fixtures only, zero game data (
scripts/check_no_game_data.pypasses with exit 0).
Verification
python -I tests/test_regen_fixtures.pyran 9 tests, OK (0.21s).- Verified
test_help_and_bad_options_leave_sources_and_fixtures_alone:--helpprints usage without modifying or overwriting existing fixtures.- Misspelled (
--chekc) or abbreviated (--chec) flags are rejected with exit code 2 and usage diagnostics viaallow_abbrev=False. - Fixtures and sources remain intact.
- Verified intermixed arguments via
parse_intermixed_args:--checkcan appear before, between, or after fixture names. python -I tests/semantic/regen_fixtures.py --help: clean exit 0.python -I tests/semantic/regen_fixtures.py --check: clean exit 0.- Merges cleanly into current
upstream/main(6a4299563) with zero conflicts. python -I -m compileall tests/semantic/regen_fixtures.py tests/test_regen_fixtures.py: clean, exit 0.git diff --check: clean (0).
LGTM. Approved.
|
Tested a735c9c merged with main 5074124 on Linux/Python 3.12.16: pass Merge is clean (tests/semantic/regen_fixtures.py, tests/semantic/README.md, tests/test_regen_fixtures.py).
|
|
Tested a735c9c on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
Summary
Claim: #7496 (comment)
Parse the arguments before marking or writing fixtures.
--helpnow prints usage and exits cleanly. Unknown and abbreviated options fail with a usage diagnostic. Valid--checkoptions can still appear before, after, or between fixture names.The semantic README now shows the existing
regen_fixtures.py NAMEworkflow. This is separate from #7582. The two patches merge cleanly in a local Git simulation.Validation
Windows 11 / Python 3.14.3 and Ubuntu 24.04 under WSL 2 / Python 3.12.3. CPU only.
6adeaf0b, both--helpand a misspelled check option overwrote a synthetic fixture. The new regression confirms that help, a misspelling, and an abbreviation leave sources and fixture bytes intact.--checkand semantictest_fixtures.pypassed, as did the diff and changed-file content checks.AI-assisted (Codex).