]> Savannah Git Hosting - gnulib.git/commitdiff
test-framework-sh: Avoid test suite failures on MSYS2.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Dec 2024 07:11:59 +0000 (08:11 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Dec 2024 13:46:15 +0000 (14:46 +0100)
* tests/init.sh (mkdir) [MSys]: New function.

ChangeLog
tests/init.sh

index e01d475534f4631d146ee735f40a590ed498c2e7..3406bd39f7a091ccddeb12ce103b9cbf7bd02477 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-12-22  Bruno Haible  <bruno@clisp.org>
+
+       test-framework-sh: Avoid test suite failures on MSYS2.
+       * tests/init.sh (mkdir) [MSys]: New function.
+
 2024-12-22  Bruno Haible  <bruno@clisp.org>
 
        execl, execle, execlp: Fix compilation error with gcc 14.
index 3bd1e3b9cd5a96cbff51913e75bcb45c7eb1e3ee..80931d7c96da7710d3fa6cb622821f5eab3cc475 100644 (file)
@@ -277,6 +277,19 @@ test -n "$EXEEXT" && test -n "$BASH_VERSION" && shopt -s expand_aliases
 #  - try to create the desired directory.
 #  - make only $MAX_TRIES_ attempts
 
+# mkdir on msys2 does not support the '-m' option.
+case `(uname -o) 2>/dev/null` in
+  Msys)
+    mkdir ()
+    {
+      if test " $1" = " -m"; then
+        shift; shift
+      fi
+      /bin/mkdir "$@"
+    }
+    ;;
+esac
+
 # Helper function.  Print $N pseudo-random bytes from a-zA-Z0-9.
 rand_bytes_ ()
 {