tests/data: support using native newlines on disk, drop .gitattributes

Data files no longer depend on mixed newline styles. Before this
patch the harness still assumed data files to use LF newlines,
ensured by `.gitattribute` and 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:
- load original data files (from test/data) so that their newline-style
  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.pl` as binary content.)
- do the same in `util.py` used by `smbserver.py` (for test 1451).
- also fix `util.py` to use us-ascii encoding for data files, replacing utf-8.

Also:
- runtests: rework the stray CR checker to allow full CRLF data files,
  and keep warning for mixed newlines.

Follow-up to 904e7ecb66 #19347

Closes #19398
This commit is contained in:
Viktor Szakats 2025-11-07 16:39:29 +01:00
parent 8e321a53df
commit f477f3efc3
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
6 changed files with 54 additions and 29 deletions

View file

@ -176,7 +176,7 @@ while(@ARGV) {
}
elsif($ARGV[0] eq "preprocess") {
shift @ARGV;
loadtest("${TESTDIR}/test${ARGV[0]}");
loadtest("${TESTDIR}/test${ARGV[0]}", 1);
readtestkeywords();
singletest_preprocess($ARGV[0]);
}