]> Savannah Git Hosting - gnulib.git/commitdiff
Avoid test failures on Microsoft Windows Subsystem for Linux.
authorBruno Haible <bruno@clisp.org>
Mon, 22 Jan 2018 04:01:48 +0000 (05:01 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 22 Jan 2018 04:01:48 +0000 (05:01 +0100)
* tests/test-fcntl.c (main): Allow a different errno.
* tests/test-rename.h (test_rename): Likewise.
* tests/test-renameat.c (main): Likewise.
* tests/test-renameat2.c (main): Likewise.

ChangeLog
tests/test-fcntl.c
tests/test-rename.h
tests/test-renameat.c
tests/test-renameat2.c

index e4801bd17e319cbd6e2cab0158130d18c0baebe8..fa3a33e860b9312fd1320a56378fecfd3f5760d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-01-21  Bruno Haible  <bruno@clisp.org>
+
+       Avoid test failures on Microsoft Windows Subsystem for Linux.
+       * tests/test-fcntl.c (main): Allow a different errno.
+       * tests/test-rename.h (test_rename): Likewise.
+       * tests/test-renameat.c (main): Likewise.
+       * tests/test-renameat2.c (main): Likewise.
+
 2018-01-14  Paul Eggert  <eggert@cs.ucla.edu>
 
        filenamecat: make base a suffix of result
index 7e726b17f82e93f454463d021095cdab9dcf9e02..476231be20cf8a9dd4ee7d3f1e1f014deffe43c7 100644 (file)
@@ -266,7 +266,8 @@ main (void)
   ASSERT (errno == EINVAL);
   errno = 0;
   ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, bad_fd) == -1);
-  ASSERT (errno == EINVAL);
+  ASSERT (errno == EINVAL
+          || errno == EMFILE /* WSL */);
 
   /* For F_DUPFD*, check for correct inheritance, as well as
      preservation of text vs. binary.  */
index f959866dd3dfce06e0abdaecc193c0a6eefa7504..0548c6cd75c8b7427ee1b1c1e1731fc9f5672535 100644 (file)
@@ -339,12 +339,14 @@ test_rename (int (*func) (char const *, char const *), bool print)
         errno = 0;
         ASSERT (func (BASE "dir2", BASE "dir/.") == -1);
         ASSERT (errno == EINVAL || errno == EBUSY || errno == EISDIR
-                || errno == ENOTEMPTY || errno == EEXIST);
+                || errno == ENOTEMPTY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       {
         errno = 0;
         ASSERT (func (BASE "dir2/.", BASE "dir") == -1);
-        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST);
+        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       ASSERT (rmdir (BASE "dir") == 0);
       /* Files present here:
@@ -366,12 +368,14 @@ test_rename (int (*func) (char const *, char const *), bool print)
         errno = 0;
         ASSERT (func (BASE "dir2", BASE "dir/.//") == -1);
         ASSERT (errno == EINVAL || errno == EBUSY || errno == EISDIR
-                || errno == ENOTEMPTY || errno == EEXIST);
+                || errno == ENOTEMPTY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       {
         errno = 0;
         ASSERT (func (BASE "dir2/.//", BASE "dir") == -1);
-        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST);
+        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       ASSERT (rmdir (BASE "dir2") == 0);
       /* Files present here:
index 5496553cb47c58951e0155960a945f1378cac1db..d72cd1f0fef8cd91f63943e4991b526c835556a2 100644 (file)
@@ -155,10 +155,12 @@ main (void)
   errno = 0;
   ASSERT (renameat (dfd, BASE "sub2", dfd, BASE "sub1/.") == -1);
   ASSERT (errno == EINVAL || errno == EISDIR || errno == EBUSY
-          || errno == ENOTEMPTY || errno == EEXIST);
+          || errno == ENOTEMPTY || errno == EEXIST
+          || errno == ENOENT /* WSL */);
   errno = 0;
   ASSERT (renameat (dfd, BASE "sub2/.", dfd, BASE "sub1") == -1);
-  ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST);
+  ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST
+          || errno == ENOENT /* WSL */);
   errno = 0;
   ASSERT (renameat (dfd, BASE "17", dfd, BASE "sub1") == -1);
   ASSERT (errno == EISDIR);
index f646cb6b38414a1e0491dcd2344060908fd34704..010489053408f07eb5d8ed36acb4bbd9c00976fe 100644 (file)
@@ -158,10 +158,12 @@ main (void)
   errno = 0;
   ASSERT (renameat2 (dfd, BASE "sub2", dfd, BASE "sub1/.", 0) == -1);
   ASSERT (errno == EINVAL || errno == EISDIR || errno == EBUSY
-          || errno == ENOTEMPTY || errno == EEXIST);
+          || errno == ENOTEMPTY || errno == EEXIST
+          || errno == ENOENT /* WSL */);
   errno = 0;
   ASSERT (renameat2 (dfd, BASE "sub2/.", dfd, BASE "sub1", 0) == -1);
-  ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST);
+  ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST
+          || errno == ENOENT /* WSL */);
   errno = 0;
   ASSERT (renameat2 (dfd, BASE "17", dfd, BASE "sub1", 0) == -1);
   ASSERT (errno == EISDIR);