-
-
Notifications
You must be signed in to change notification settings - Fork 7k
tests/data: support using native newlines on disk, drop .gitattributes
#19398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
|
Oh noes, we need to enforce LF on Windows for git checkouts. |
.gitattributes.gitattributes
This comment was marked as resolved.
This comment was marked as resolved.
59e9b60 to
5ed2b2d
Compare
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Nov 9, 2025
Use `%TESTNUMBER` instead. Ref: curl#19398
2 tasks
vszakats
added a commit
that referenced
this pull request
Nov 9, 2025
Before this patch servers were loading the original data source file (from `tests/data/test*`) if they failed to open the preprocessed data file. It was causing issues in many (most?) tests, because original data files are not preprocessed, thus may be incomplete and/or come with wrong newline characters. It's also causing difficult to diagnose issues when a test accidentally references another test's data, which by chance makes the test pass initially, until either that or the executed test data gets an update, and breaking it, as seen in #19329. Historically, the fallback existed first, then the preprocessed copy. The fallback is no longer used by tests (except by stray accidents). Fix it by dropping the fallback logic and relying on the preprocessed data file saved there by the runtests framework. Also fix two remaining test data cross-references: - test1565: reference own server input data instead of test1's. - test3014: reference own server input data instead of test1439's. Ref: #19398 Follow-up to aaf9522 #19329 Closes #19429
.gitattributes.gitattributes, let it use native newlines on disk
.gitattributes, let it use native newlines on disk.gitattributes, support using native newlines on disk
.gitattributes, support using native newlines on disk.gitattributes
No longer necessary after switching to LF-only newlines for data files. Follow-up to 904e7ec curl#19347
Also replace the text number with the only test that's actually read by this code. (via smbserver.py) Tested with: ``` . ../.venv/bin/activate && TFLAGS='-d -v 1451' ninja tests ```
on Linux: ``` --- log/4/check-expected 2025-11-09 14:44:45.020166727 +0000 +++ log/4/check-generated 2025-11-09 14:44:45.020166727 +0000 @@ -1,8 +1,8 @@ -HTTP/1.1 200 OK[CR][LF] -Date: Tue, 09 Nov 2010 14:49:00 GMT[CR][LF] -Content-Length: 9[CR][LF] -Connection: close[CR][LF] -Content-Type: text/plain[CR][LF] -[CR][LF] +HTTP/1.1 200 OK[LF] +Date: Tue, 09 Nov 2010 14:49:00 GMT[LF] +Content-Length: 9[LF] +Connection: close[LF] +Content-Type: text/plain[LF] +[LF] testdata[LF] 4 ```
This reverts commit 20b693a.
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Nov 13, 2025
Follow-up to f477f3e curl#19398
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Data files no longer depend on mixed newline styles. Before this
patch the harness still assumed data files to use LF newlines,
ensured by
.gitattributeand distributing sources with LF newlines.To allow using platform native newlines (CRLF on Windows typically),
update the test harness to support data files with any newline style
on disk. And delete
.gitattributes.Fix to:
doesn't matter on the checked out source repo, meaning it works
when its CRLF on Windows, just like any other file.
(if a BOM slips in, it's caught by
spacecheck.plas binary content.)util.pyused bysmbserver.py(for test 1451).util.pyto use us-ascii encoding for data files, replacing utf-8.Also:
and keep warning for mixed newlines.
Follow-up to 904e7ec #19347
test2fopen()#19429.Ref: https://github.com/curl/curl/actions/runs/19209453941/job/54909482696?pr=19398#step:13:3433