tests: bundle http clients, de-dupe, enable for MSVC

To make building the http client tests faster, with no duplication, by
using the build method that other test binaries already use.

The difference compared to other tests is that these don't use internal
libcurl headers or code. With the exception of `curl_config.h`, for
a feature macro.

Before this patch, these tests were built like examples.

Also:
- de-duplicate code and give unique names to colliding symbols.
- add local getopt implementation and enable all code for MSVC.
  Adapted for curl via Public Domain source:
  4e618ef782/getopt.h
  Credits-to: Christopher Wellons
  Thanks!

Closes #17627
This commit is contained in:
Viktor Szakats 2025-06-15 14:48:46 +02:00
parent 6828009695
commit 739c09c8a4
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
25 changed files with 677 additions and 1242 deletions

View file

@ -76,7 +76,7 @@ if($any_test) {
my $tlist = "";
foreach my $src (@src) {
if($src =~ /([a-z0-9]+)\.c$/) {
if($src =~ /([a-z0-9_]+)\.c$/) {
my $name = $1;
if($embed) {
my $fn = $src;