On Cygwin 3.4.6 and older, but not on Cygwin 3.5.3, I see the
'test-passfd' test fail. Since the source code of Cygwin 3.5.3
does not handle SCM_RIGHTS, it must be a spurious success.

This patch marks the test as expecting to fail on Cygwin.


2024-05-23  Bruno Haible  <br...@clisp.org>

        passfd tests: Mark as expected failure on Cygwin.
        * tests/test-passfd.c (main): Always fail on Cygwin.
        * modules/passfd-tests (Depends-on): Add test-xfail.
        (Makefile.am): Expect that test-passfd fails on Cygwin.

diff --git a/modules/passfd-tests b/modules/passfd-tests
index 9bb1c5c1be..4d304349f1 100644
--- a/modules/passfd-tests
+++ b/modules/passfd-tests
@@ -4,6 +4,7 @@ tests/macros.h
 
 Depends-on:
 sys_wait
+test-xfail
 
 configure.ac:
 AC_CHECK_DECLS_ONCE([alarm])
@@ -13,3 +14,7 @@ Makefile.am:
 TESTS += test-passfd
 check_PROGRAMS += test-passfd
 test_passfd_LDADD = $(LDADD) @LIBSOCKET@
+
+if OS_IS_CYGWIN
+XFAIL_TESTS += test-passfd
+endif
diff --git a/tests/test-passfd.c b/tests/test-passfd.c
index 2e11439d7e..dd039b4910 100644
--- a/tests/test-passfd.c
+++ b/tests/test-passfd.c
@@ -34,7 +34,12 @@
 int
 main ()
 {
-#if HAVE_SOCKETPAIR
+#if defined __CYGWIN__
+  /* Cygwin does not support file-descriptor passing: As on Cygwin 3.5.3,
+     the only cmsg_type that winsup/cygwin/fhandler/socket_unix.cc handles
+     is SCM_CREDENTIALS.  Not SCM_RIGHTS.  */
+  return 90;
+#elif HAVE_SOCKETPAIR
   int pair[2];
   int ret;
   pid_t pid;




Reply via email to