Skip to content

fix(wine): match CTest output regexes across CRLF (Codex) - #6134

Open
evilclanker9000 wants to merge 3 commits into
ItsNotRexed:mainfrom
evilclanker9000:codex/wine-ctest-crlf-regex
Open

evilclanker9000 wants to merge 3 commits into
ItsNotRexed:mainfrom
evilclanker9000:codex/wine-ctest-crlf-regex

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: EGEN-WINE-CTEST-CRLF-REGEX

What and why

Match Wine test output against CTest's line boundaries for all three output regex properties. Previously, a forbidden pattern spanning two CRLF-separated lines could go undetected. The runner now normalizes carriage returns at line boundaries for matching and retains raw diagnostic output.

Tested

  • Windows 10/11 host, Python 3.12.10. A source-built Python fixture writes exact bytes to the child process's stdout. On base 561b65a8, six CRLF and repeated-CR cases returned the wrong fail, pass or skip result. On 6bf7c74d, all cases passed, including the LF control, the lone-CR control and raw diagnostic checks.
  • python -I tests/test_run_wine_tests.py: 60 tests with 8 skips at the implementation commit using the unchanged test suite, then 61 tests with 8 skips at the regression-test commit. Windows CTest 3.31.6-msvc6 independently failed the forbidden pattern on LF and CRLF, passed the required pattern and skipped the skip pattern.
  • CPU-only. No Wine installation, GPU run or game inputs required.

AI-assisted: yes

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.
  • Translator contract table update (not applicable).

AI-assisted.

CTest ignores carriage returns at line boundaries when applying output expressions. Matching the raw process output can hide a forbidden diagnostic under Wine.
Cover each CTest output expression and ensure that an embedded carriage return remains visible in diagnostics.

@DoubleD17 DoubleD17 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CTest also treats NUL as a line boundary when matching output

At 6bf7c74d29d5da0336e8045ae63308b272c97796, the normalization covers LF and CRLF, including consecutive CRs. CTest's line reader also treats NUL as a line boundary and strips the preceding CRs there.

On Windows with CTest 3.31.12, a synthetic child that exits 0 after writing b"PREFIX\x00SUFFIX\n" fails under FAIL_REGULAR_EXPRESSION set to PREFIX\nSUFFIX. CTest exits 8 and its JUnit marks the test failed. With the same pattern as SKIP_REGULAR_EXPRESSION, CTest skips both the NUL and CR+NUL cases. At the reviewed head, the substitution leaves those byte sequences in the decoded output and the pattern misses, so the forbidden case would still pass. This gap also exists on the base.

Could the matching view treat both LF and NUL as boundaries and cover the NUL case in the existing synthetic matrix? The diagnostic output can retain the original text. I ran native CTest with a synthetic child, checked the regex input independently, and assessed the PR behavior by inspecting the diff.

No game files. AI-assisted.

CTest also starts a new output line at NUL and drops preceding carriage returns. Compare the same boundaries without changing the raw diagnostic.
@evilclanker9000

Copy link
Copy Markdown
Contributor Author

Updated in 294ef56. Windows CTest 3.31.6-msvc6 reproduced fail on NUL, pass on CR+NUL, and skip on repeated CR+NUL. All nine new Wine-runner cases failed at the reviewed head and now pass. The full Windows suite reports 53 passed and 8 skipped. Diagnostics still retain the original bytes after decoding. AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants