tests: run repeated CLI checks in-process in dxil_retarget_check #1633

Merged
tedin7 merged 1 commit from upstream-pr/1640 into main 2026-11-24 16:05:08 +00:00
tedin7 commented 2026-11-24 15:34:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:34:06Z.


Summary

  • Refactor tools/dxil_retarget.py to accept argv: list[str] | None = None in main(), delegating execution to _run_cli(args, parser) and catching (OSError, ValueError) inside main() with exit code 1 and formatted stderr output matching CLI behavior.
  • Convert the 11 repeated pure-Python CLI invocations in tests/dxil_retarget_check.py (--extract-module, 5 invalid-argument checks, 3 damaged-input checks, missing-input check, and --pso-probe without --probe) to an in-process _run_cli() helper with CPython SystemExit(None | int | str) semantics.
  • Keep the end-to-end subprocess.check_output smoke test for the main DXBC retargeting CLI path unchanged.

Benchmark (Linux, 3-run median)

  • Before: 1.998s ([1.926s, 1.999s, 1.998s])
  • After: 0.415s ([0.415s, 0.428s, 0.396s]) — -79.2% (-1.582s)

Test Plan

  • python3 -B tests/dxil_retarget_check.py
  • python3 -B tests/docs_links_check.py
  • python3 -B tests/bidi_controls_check.py
  • ctest --test-dir out/build/dev -R "dxil_retarget" --output-on-failure (Win2025)

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6585440935 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1640). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T15:34:06Z. --- ## Summary - Refactor `tools/dxil_retarget.py` to accept `argv: list[str] | None = None` in `main()`, delegating execution to `_run_cli(args, parser)` and catching `(OSError, ValueError)` inside `main()` with exit code `1` and formatted `stderr` output matching CLI behavior. - Convert the 11 repeated pure-Python CLI invocations in `tests/dxil_retarget_check.py` (`--extract-module`, 5 invalid-argument checks, 3 damaged-input checks, missing-input check, and `--pso-probe` without `--probe`) to an in-process `_run_cli()` helper with CPython `SystemExit(None | int | str)` semantics. - Keep the end-to-end `subprocess.check_output` smoke test for the main DXBC retargeting CLI path unchanged. ## Benchmark (Linux, 3-run median) - Before: `1.998s` (`[1.926s, 1.999s, 1.998s]`) - After: `0.415s` (`[0.415s, 0.428s, 0.396s]`) — `-79.2%` (`-1.582s`) ## Test Plan - `python3 -B tests/dxil_retarget_check.py` - `python3 -B tests/docs_links_check.py` - `python3 -B tests/bidi_controls_check.py` - `ctest --test-dir out/build/dev -R "dxil_retarget" --output-on-failure` (Win2025) AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-24 16:03:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T15:42:57Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T15:46:15.104972Z 845eddb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7136489966 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1640#issuecomment-7136489966). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T15:42:57Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"845eddbed073f32cf408efb1ac26d7a36696b77f","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T15:46:15.104972Z">2026-11-24T15:46:15.104972Z</relative-time> | `845eddb` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
upstream-sync closed this pull request 2026-11-24 17:01:46 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1633
No description provided.