]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
openat2 tests: Avoid gratuitous test failure when debugging.
authorBruno Haible <bruno@clisp.org>
Sat, 1 Nov 2025 11:47:38 +0000 (12:47 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 1 Nov 2025 12:01:35 +0000 (13:01 +0100)
* tests/test-openat2.c: Include ignore-value.h.
(do_prepare): Remove left-overs on disk.
* modules/openat2-tests (Depends-on): Add ignore-value.

ChangeLog
modules/openat2-tests
tests/test-openat2.c

index c02c1c14b95a3a8ff82ffa6f3e00c60b9de62f31..8d0aa9f023af70a04b8eb337bb89f5f824c44a17 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-11-01  Bruno Haible  <bruno@clisp.org>
+
+       openat2 tests: Avoid gratuitous test failure when debugging.
+       * tests/test-openat2.c: Include ignore-value.h.
+       (do_prepare): Remove left-overs on disk.
+       * modules/openat2-tests (Depends-on): Add ignore-value.
+
 2025-11-01  Bruno Haible  <bruno@clisp.org>
 
        fprintftime: Return -1 on output error.
index 88126f60ad4fc6b2e12be4a32e22b17f233aba6c..25a0ea2edb39cc5bbab2b46231ca9d3ae416356a 100644 (file)
@@ -7,6 +7,7 @@ tests/macros.h
 Depends-on:
 close
 fcntl
+ignore-value
 mkdirat
 stdcountof-h
 stdint-h
index fc93a7a9a910fded2767f02d1311d436cc38e92f..a3832992ec91e16d7faf96079ed7b14a594c0099 100644 (file)
@@ -36,6 +36,7 @@ SIGNATURE_CHECK (openat2, int, (int, char const *,
 # include <signal.h>
 #endif
 
+#include "ignore-value.h"
 #include "macros.h"
 
 #define BASE "test-openat2.t"
@@ -71,6 +72,9 @@ do_open (char const *name, int flags, ...)
 static void
 do_prepare ()
 {
+  /* Remove any leftovers from a previous partial run.  */
+  ignore_value (system ("rm -rf " BASE "*"));
+
   /*
      Construct a test directory with the following structure: