Skip to content

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Dec 1, 2025

To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in .c files.

Non-XML-compliant files are down to 36 after this patch.

Also:

  • make all macro expansions apply to %includetext contents.

Not entirely without faults, though maybe something to consider.

  • see if possible to add macro replacements for HOSTIP, *PORT, TESTNUMBER, LOGPATH, possibly more, in included files.
  • the conditions to generate CURLOPT_USERAGENT with --libcurl are 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 (?).

@github-actions github-actions bot added the tests label Dec 1, 2025
@vszakats vszakats marked this pull request as draft December 1, 2025 22:34
@vszakats vszakats force-pushed the tlibcurl branch 3 times, most recently from 3a641d4 to e2f78cf Compare December 8, 2025 15:13
@vszakats vszakats marked this pull request as ready for review December 8, 2025 16:07
@vszakats vszakats requested a review from Copilot December 8, 2025 17:19
Copy link

Copilot AI left a 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() and subchars() functions to support including external text files with proper variable substitution
  • Moved --libcurl generated C code from 11 test files to separate data*.c files
  • Removed the notxml keyword 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.

Copy link

Copilot AI left a 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.

Copy link

Copilot AI left a 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.

@vszakats vszakats closed this in d75716e Dec 8, 2025
@vszakats vszakats deleted the tlibcurl branch December 8, 2025 23:20
vszakats added a commit to vszakats/curl that referenced this pull request Dec 9, 2025
vszakats added a commit that referenced this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant