]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test: add `cygwin` feature and use it (test 1056, 1517)
authorViktor Szakats <commit@vsz.me>
Wed, 20 Aug 2025 18:00:49 +0000 (20:00 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 21 Aug 2025 11:11:32 +0000 (13:11 +0200)
To replace custom checks with the same effect.

Closes #18327

docs/tests/FILEFORMAT.md
tests/data/test1056
tests/data/test1517
tests/libtest/lib1517.c
tests/runtests.pl

index a58eb132050d147e83b3936c6dd7154f3b98b86f..3bb1acb256740c32048c293d8c36c274b4283d04 100644 (file)
@@ -455,6 +455,7 @@ Features testable here are:
 - `codeset-utf8`. If the running codeset is UTF-8 capable.
 - `cookies`
 - `crypto`
+- `cygwin`
 - `Debug`
 - `digest`
 - `DoH`
index afcdf137ee28a9b33eef9132795bf0a4ae130fae..302b9c541276eaa29642792d54520e7ea5de76a6 100644 (file)
@@ -45,10 +45,10 @@ body
 # This test relies on the IPv6 scope field being ignored when connecting to
 # ipv6-localhost (i.e. [::1%259999] is treated as [::1]). Maybe this is a bit
 # dodgy, but it happens on all our test platforms but Windows so skip this
-# test there. This feature doesn't work on msys or Cygwin, so use a precheck
-# to skip those.
+# test there. Not supported on the Windows kernel, this includes MSYS2/Cygwin.
 <features>
 IPv6
+!cygwin
 !win32
 </features>
 <server>
@@ -61,9 +61,6 @@ HTTP follow redirect from IPv4 to IPv6 with scope
 <command>
 http://%HOSTIP:%HTTPPORT/we/are/all/twits/%TESTNUMBER -L
 </command>
-<precheck>
-%PERL -e "print 'Test is not supported on the Windows kernel' if($^O eq 'MSWin32' || $^O eq 'msys' || $^O eq 'cygwin');"
-</precheck>
 </client>
 
 #
index 5f053795958c087f8d447a9c747f1a29ddb2d974..18d1fcaf2f094944b36a94f2f7c533f132b2a82a 100644 (file)
@@ -36,6 +36,11 @@ This is a virtual description of server virtual error.
 
 # Client-side
 <client>
+# Windows TCP does not deliver response data but reports CONNABORTED
+<features>
+!cygwin
+!win32
+</features>
 <server>
 http
 </server>
@@ -43,12 +48,6 @@ http
 <tool>
 lib%TESTNUMBER
 </tool>
-# precheck is a command line to run before the test, to see if we can execute
-# the test or not
-<precheck>
-%LIBTESTS lib%TESTNUMBER check
-</precheck>
-
 <name>
 HTTP POST, server responds before completed send
 </name>
index c542aad032d488cc07f5bcdfc618001efdb0f4b6..d8ad3b753bb2e4d7117c59816a4c6aa6c2a5d4dc 100644 (file)
@@ -61,17 +61,6 @@ static CURLcode test_lib1517(const char *URL)
 
   struct t1517_WriteThis pooh;
 
-  if(!strcmp(URL, "check")) {
-#if (defined(_WIN32) || defined(__CYGWIN__))
-    curl_mprintf("Windows TCP does not deliver response data but reports "
-                 "CONNABORTED\n");
-    return TEST_ERR_FAILURE; /* skip since it fails on Windows without
-                                workaround */
-#else
-    return CURLE_OK; /* sure, run this! */
-#endif
-  }
-
   pooh.readptr = testdata;
   pooh.sizeleft = strlen(testdata);
 
index a470597bf6d6aa39565674331acfdeb6049e9c29..9064d799c3a1b7a25cc299d6d364ca9106beb799 100755 (executable)
@@ -568,6 +568,9 @@ sub checksystemfeatures {
                 $pwd = sys_native_current_path();
                 $feature{"win32"} = 1;
             }
+            if($curl =~ /cygwin|msys/i) {
+                $feature{"cygwin"} = 1;
+            }
             if($libcurl =~ /\sschannel\b/i) {
                 $feature{"Schannel"} = 1;
                 $feature{"SSLpinning"} = 1;