bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test-framework-sh: Avoid test suite failures on MSYS2


From: Bruno Haible
Subject: test-framework-sh: Avoid test suite failures on MSYS2
Date: Sun, 22 Dec 2024 08:29:24 +0100

In a recent MSYS2, 42 unit tests fail because the MSYS2 'mkdir' program
produces an error when the options "-m 0700" are used:

test-set-mode-acl-1.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-set-mode-acl-1.sh.SaAv':
 Permission denied
test-set-mode-acl-2.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-set-mode-acl-2.sh.90VL':
 Permission denied
test-copy-acl-1.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-copy-acl-1.sh.B8Id':
 Permission denied
test-copy-acl-2.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-copy-acl-2.sh.1rg5':
 Permission denied
test-argp-2.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-argp-2.sh.PcCU':
 Permission denied
test-argp-version-etc-1.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-argp-version-etc-1.sh.9Pkh':
 Permission denied
test-atexit.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-atexit.sh.W0s3':
 Permission denied
test-closein.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-closein.sh.ZkQp':
 Permission denied
test-copy-file-1.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-copy-file-1.sh.5aQJ':
 Permission denied
test-copy-file-2.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-copy-file-2.sh.vlWw':
 Permission denied
test-dfa-invalid-char-class.sh: failed test: mkdir: cannot change permissions 
of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-dfa-invalid-char-class.sh.kPnt':
 Permission denied
test-dfa-invalid-merge.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-dfa-invalid-merge.sh.vBpw':
 Permission denied
test-dfa-match.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-dfa-match.sh.V1LL':
 Permission denied
test-error.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-error.sh.o98N':
 Permission denied
test-exclude1.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude1.sh.yjjm':
 Permission denied
test-exclude2.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude2.sh.4F0r':
 Permission denied
test-exclude3.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude3.sh.pSXl':
 Permission denied
test-exclude4.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude4.sh.eieO':
 Permission denied
test-exclude5.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude5.sh.LNlq':
 Permission denied
test-exclude6.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude6.sh.n705':
 Permission denied
test-exclude7.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude7.sh.Kcla':
 Permission denied
test-exclude8.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-exclude8.sh.rtfJ':
 Permission denied
test-file-has-acl-1.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-file-has-acl-1.sh.wkf8':
 Permission denied
test-file-has-acl-2.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-file-has-acl-2.sh.08yB':
 Permission denied
test-getcwd.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-getcwd.sh.aKe8':
 Permission denied
test-perror.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-perror.sh.5S71':
 Permission denied
test-pread.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-pread.sh.LjUA':
 Permission denied
test-pwrite.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-pwrite.sh.Xc3V':
 Permission denied
test-readtokens.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-readtokens.sh.cI0a':
 Permission denied
test-string-desc.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-string-desc.sh.JKdl':
 Permission denied
test-init.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-init.sh.nnn1': 
Permission denied
test-vc-list-files-git.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-vc-list-files-git.sh.kQ3Z':
 Permission denied
test-vc-list-files-cvs.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-vc-list-files-cvs.sh.uj7K':
 Permission denied
test-verify.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-verify.sh.iPUc':
 Permission denied
test-verror.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-verror.sh.TJMr':
 Permission denied
test-version-etc.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-version-etc.sh.dGSm':
 Permission denied
test-xalloc-die.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-xalloc-die.sh.QpnZ':
 Permission denied
test-xstrtoimax.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-xstrtoimax.sh.TE31':
 Permission denied
test-xstrtol.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-xstrtol.sh.z0e3':
 Permission denied
test-xstrtoll.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-xstrtoll.sh.95pq':
 Permission denied
test-xstrtoumax.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-xstrtoumax.sh.hCiB':
 Permission denied
test-yesno.sh: failed test: mkdir: cannot change permissions of 
'/home/bruno/testdir-all-for-mingw/build-mingw64/gltests/gt-test-yesno.sh.Htgh':
 Permission denied

This patch works around it. Directory access permissions are not like in
POSIX anyway, on native Windows.


2024-12-22  Bruno Haible  <bruno@clisp.org>

        test-framework-sh: Avoid test suite failures on MSYS2.
        * tests/init.sh (mkdir) [MSys]: New function.

diff --git a/tests/init.sh b/tests/init.sh
index 3bd1e3b9cd..80931d7c96 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -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_ ()
 {






reply via email to

[Prev in Thread] Current Thread [Next in Thread]