-
-
Notifications
You must be signed in to change notification settings - Fork 7k
tests/data: move --libcurl output to external data files
#19799
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
Conversation
3a641d4 to
e2f78cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the curl test suite to move --libcurl output from inline test data to external .c files, making test files XML-compliant and potentially easier to manage.
Key changes:
- Introduced
subtextfile()andsubchars()functions to support including external text files with proper variable substitution - Moved
--libcurlgenerated C code from 11 test files to separatedata*.cfiles - Removed the
notxmlkeyword from affected tests, making them XML-compliant
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/testutil.pm | Added subtextfile() and subchars() functions; refactored character substitution logic out of subbase64() |
| tests/runner.pm | Integrated subtextfile() and subchars() into preprocessing pipeline with proper variable substitution ordering |
| tests/data/test1481 | Replaced inline C code with %includetext directive; removed notxml keyword and USERAGENT stripfile rule |
| tests/data/test1465 | Replaced inline C code with %includetext directive; removed notxml keyword |
| tests/data/test1420 | Moved C code to external file; removed notxml keyword and USERAGENT stripfile rule |
| tests/data/test1407 | Moved C code to external file; removed notxml keyword and USERAGENT stripfile rule |
| tests/data/test1406 | Moved C code to external file; removed notxml keyword and USERAGENT stripfile rule |
| tests/data/test1405 | Moved C code to external file; removed notxml keyword and USERAGENT stripfile comment/rule |
| tests/data/test1404 | Replaced inline C code with %includetext directive; removed notxml keyword and USERAGENT stripfile rules |
| tests/data/test1403 | Replaced inline C code with %includetext directive; removed notxml keyword and USERAGENT stripfile rules |
| tests/data/test1402 | Replaced inline C code with %includetext directive; removed notxml keyword and USERAGENT stripfile rules |
| tests/data/test1401 | Replaced inline C code with %includetext directive; removed notxml keyword |
| tests/data/test1400 | Replaced inline C code with %includetext directive; removed notxml keyword and USERAGENT stripfile rule |
| tests/data/data1481.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1465.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1420.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1407.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1406.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1405.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1404.c | New file containing extracted --libcurl output (contains hardcoded test numbers) |
| tests/data/data1403.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1402.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1401.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/data1400.c | New file containing extracted --libcurl output with proper variable placeholders |
| tests/data/Makefile.am | Added all new data*.c files to EXTRA_DIST for distribution |
| scripts/checksrc-all.pl | Added exclusion pattern to skip source checking for test data .c files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
when LOGDIR contains a slash
```
tests/data/test1402:52: parser error : EntityRef: expecting ';'
foo=bar&baz=quux
^
tests/data/test1403:45: parser error : EntityRef: expecting ';'
GET /we/want/%TESTNUMBER?foo=bar&baz=quux HTTP/1.1
^
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow-up to d75716e curl#19799 Cherry-picked from curl#19882
To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in
.cfiles.Non-XML-compliant files are down to 36 after this patch.
Also:
%includetextcontents.Not entirely without faults, though maybe something to consider.
HOSTIP,*PORT,TESTNUMBER,LOGPATH, possibly more, in included files.CURLOPT_USERAGENTwith--libcurlare breaking the tests, after removing the trick to strip this line from all resuls. Turns out it's included based on which protocols curl supports, not based on the protocol used in the actual request. I guess the latter may lead to a rabbit-hole if the protocol is unspecified or possibly a variable (?).