]> Savannah Git Hosting - gnulib.git/commitdiff
fdutimensat, utimensat tests: Fix test failures on Cygwin.
authorBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 14:15:50 +0000 (16:15 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 16:27:58 +0000 (18:27 +0200)
* tests/nap.h: Include concat-filename.h, xgetcwd.h.
(nap_file): New variable.
(nap_get_stat, clear_temp_file): Use nap_file, not TEMPFILE.
(nap): Initialize nap_file.
* modules/chown-tests (Depends-on): Add xconcat-filename, xgetcwd.
* modules/fchownat-tests (Depends-on): Likewise.
* modules/fdutimensat-tests (Depends-on): Likewise.
* modules/futimens-tests (Depends-on): Likewise.
* modules/lchown-tests (Depends-on): Likewise.
* modules/stat-time-tests (Depends-on): Likewise.
* modules/utime-tests (Depends-on): Likewise.
* modules/utimens-tests (Depends-on): Likewise.
* modules/utimensat-tests (Depends-on): Likewise.

ChangeLog
modules/chown-tests
modules/fchownat-tests
modules/fdutimensat-tests
modules/futimens-tests
modules/lchown-tests
modules/stat-time-tests
modules/utime-tests
modules/utimens-tests
modules/utimensat-tests
tests/nap.h

index 62174deac91f508d4fdc3999b3bf38e1c4d2b1e8..2ca3538a9c6e529717d4463d0d7d9cbba771f71f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2024-08-12  Bruno Haible  <bruno@clisp.org>
+
+       fdutimensat, utimensat tests: Fix test failures on Cygwin.
+       * tests/nap.h: Include concat-filename.h, xgetcwd.h.
+       (nap_file): New variable.
+       (nap_get_stat, clear_temp_file): Use nap_file, not TEMPFILE.
+       (nap): Initialize nap_file.
+       * modules/chown-tests (Depends-on): Add xconcat-filename, xgetcwd.
+       * modules/fchownat-tests (Depends-on): Likewise.
+       * modules/fdutimensat-tests (Depends-on): Likewise.
+       * modules/futimens-tests (Depends-on): Likewise.
+       * modules/lchown-tests (Depends-on): Likewise.
+       * modules/stat-time-tests (Depends-on): Likewise.
+       * modules/utime-tests (Depends-on): Likewise.
+       * modules/utimens-tests (Depends-on): Likewise.
+       * modules/utimensat-tests (Depends-on): Likewise.
+
 2024-08-10  Bruno Haible  <bruno@clisp.org>
 
        Make sure gperf-generated files are the same in VPATH builds.
index d013be17e7245f656e6c4f8d372949db93f9553d..520c00dfb381d46b9b75ca404f9254e1007f9ec2 100644 (file)
@@ -14,6 +14,8 @@ stat-time
 stdbool
 stdckdint
 symlink
+xconcat-filename
+xgetcwd
 
 configure.ac:
 AC_CHECK_FUNCS_ONCE([getgid getegid])
index f11d02cddec7378a2c628968171899156044f3c0..2f804eccc12e8f19a4ef83c10c636fff85adfb80 100644 (file)
@@ -15,6 +15,8 @@ openat-h
 stat-time
 stdckdint
 symlink
+xconcat-filename
+xgetcwd
 
 configure.ac:
 AC_CHECK_FUNCS_ONCE([getgid getegid])
index c2f0d59f3dea289525bc509872592f3eb58cb91f..f4eb2ecc04e321fbaf80baa4210535e0c4bf99cd 100644 (file)
@@ -16,6 +16,8 @@ stdckdint
 timespec
 dup
 utimecmp
+xconcat-filename
+xgetcwd
 
 configure.ac:
 
index c6f62d9d3cd02ff073f62ad7728dee44daf51332..7781dff3d337e24ecb7fe429383685ee72b6f01f 100644 (file)
@@ -15,6 +15,8 @@ stdckdint
 timespec
 dup
 utimecmp
+xconcat-filename
+xgetcwd
 
 configure.ac:
 
index 2954701eeb456e5dd1ef28ec0ae9eae2dfc5e6b2..a66d624b30898b018278c12fca5b784de4e191f7 100644 (file)
@@ -14,6 +14,8 @@ stdckdint
 stat-time
 stdbool
 symlink
+xconcat-filename
+xgetcwd
 
 configure.ac:
 AC_CHECK_FUNCS_ONCE([getgid getegid])
index 0a8193783d7c99579c7ddc371ace32a6552c38b5..50addb33fcfd8ce38fa48c334717f4f34d3d19e8 100644 (file)
@@ -8,6 +8,8 @@ nanosleep
 stdckdint
 time-h
 unistd
+xconcat-filename
+xgetcwd
 
 configure.ac:
 
index 146180e04b23e8798b41333eccaac9895034aad1..e354b476b8a476b1d9db95ee770ce5a2c208b339 100644 (file)
@@ -13,6 +13,8 @@ stdckdint
 symlink
 timespec
 utimecmp
+xconcat-filename
+xgetcwd
 
 configure.ac:
 
index 381139c8ddd3c33e6467e4e434b8e78551dee6c7..3899bf08d4c17eb9763bf8a1671d5cc572a30eec 100644 (file)
@@ -16,6 +16,8 @@ stdckdint
 symlink
 timespec
 utimecmp
+xconcat-filename
+xgetcwd
 
 configure.ac:
 
index 0ba5e09e02389812e1b6fadc7648f5f29005bca3..03c8d9990fc1ee4a63a4f24b377637c8161696b8 100644 (file)
@@ -13,6 +13,8 @@ nanosleep
 stdckdint
 timespec
 utimecmp
+xconcat-filename
+xgetcwd
 
 configure.ac:
 
index cf7d998b800e99727f4f1d0a8d2719d7bf7892d7..1b9ae59287d86241c2bb074806d8962947364b8d 100644 (file)
 # define GLTEST_NAP_H
 
 # include <limits.h>
-
 # include <stdckdint.h>
 
+# include "concat-filename.h"
+# include "xgetcwd.h"
+
 /* Avoid a conflict with a function called nap() on UnixWare.  */
 # if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__)  /* OpenServer, UnixWare */
 #  include <unistd.h>
@@ -33,6 +35,9 @@
 /* Name of the witness file.  */
 #define TEMPFILE BASE "nap.tmp"
 
+/* Absolute name of the witness file.  */
+static char *nap_file /* = NULL */;
+
 /* File descriptor used for the witness file.  */
 static int nap_fd = -1;
 
@@ -75,7 +80,7 @@ nap_get_stat (struct stat *st, int do_write)
          is closed. See
          <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-writefile> */
       close (nap_fd);
-      nap_fd = open (TEMPFILE, O_RDWR, 0600);
+      nap_fd = open (nap_file, O_RDWR, 0600);
       ASSERT (nap_fd != -1);
       lseek (nap_fd, 0, SEEK_END);
 #endif
@@ -108,7 +113,7 @@ clear_temp_file (void)
   if (0 <= nap_fd)
     {
       ASSERT (close (nap_fd) != -1);
-      ASSERT (unlink (TEMPFILE) != -1);
+      ASSERT (unlink (nap_file) != -1);
     }
 }
 
@@ -127,8 +132,9 @@ nap (void)
 
   if (-1 == nap_fd)
     {
+      nap_file = xconcatenated_filename (xgetcwd (), TEMPFILE, NULL);
       atexit (clear_temp_file);
-      ASSERT ((nap_fd = creat (TEMPFILE, 0600)) != -1);
+      ASSERT ((nap_fd = creat (nap_file, 0600)) != -1);
       nap_get_stat (&old_st, 0);
     }
   else