Skip to content

[JUnit] Fix Windows drive paths - #860

Merged
mvandervoord merged 1 commit into
ThrowTheSwitch:masterfrom
nailongzhanshen666:fix/junit-windows-paths
Oct 29, 2026
Merged

mvandervoord merged 1 commit into
ThrowTheSwitch:masterfrom
nailongzhanshen666:fix/junit-windows-paths

Conversation

@nailongzhanshen666

Copy link
Copy Markdown
Contributor

🍍

Fixes #628.

The Python JUnit converter treated the colon in a Windows drive letter as a field separator. With a path such as C:\Path\test_example.c:24:test_example:FAIL:message, this produced a testcase named 24 with no failure. The existing forward-slash parser also truncated paths containing spaces.

  • Recognize drive-letter paths with either slash style, including spaces, before parsing the remaining result fields.
  • Add end-to-end XML regression coverage for Windows, Unix and relative paths, plus PASS and IGNORE results.
  • Update the changelog.

The issue discussion by @lukzeg identified the backslash path case.

Testing: PYTHONPATH=/tmp/unity-junit-xml python3 -m unittest discover -s test -p test_stylize_as_junit.py -v (2 tests passed; Python 3.12 and pyparsing 3.1.1). The junit-xml library was obtained from its upstream repository for local testing because the local package proxy was unavailable. git diff --check passed. Existing resource and deprecation warnings were observed.

This contribution was developed with AI assistance and reviewed by the contributor.

Drive-letter paths were split at the colon, which could turn failing tests into successful JUnit cases. Recognize Windows paths before parsing the result fields.

Fixes ThrowTheSwitch#628

Signed-off-by: zhouzhuohua <zhouzhuohua27@163.com>
@mvandervoord
mvandervoord merged commit 56cd980 into ThrowTheSwitch:master Oct 29, 2026
4 checks passed
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.

Colon as a separator leads to wrong behavior when parsing to JUnit with unity_to_junit.py on Windows

2 participants