[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix tests under Windows
From: |
Peter Bex |
Subject: |
[PATCH] Fix tests under Windows |
Date: |
Thu, 2 Sep 2021 10:26:00 +0200 |
Hi all,
As Vasilij already reported, there are two failing tests under mingw.
They initially fail for the same reason - they try to delete files
that have been opened but not closed, which is an error under Windows.
After fixing this, the posix-tests fail due to the fact that Windows
doesn't fully support file modes. It doesn't know about execute
permissions, and doesn't support making files write-only or having
files with no permissions.
To fix that, we can conceptually "right-extend" the user permissions
over group and others after adding read permissions (as Windows does
not have files without read permissions) and dropping execute
permissions. In code, I cond-expand on Windows, shift the group and
other bits out to obtain the user bits, and then dispatch on the values
to get read and write access or read-only access.
With these patches in place, the tests pass once again on mingw-msys.
Why we never noticed before? The POSIX tests were extended in ffe553,
and the read-lines-test was added in cfa1e7, both of which were added
somewhere between 5.2.0 and 5.3.0rc1. And on *nix these tests work
fine, of course...
Cheers,
Peter
0001-Ensure-all-ports-are-closed-in-tests-when-deleting-t.patch
Description: Text Data
0002-Fix-posix-tests-file-permission-test-on-Windows.patch
Description: Text Data
signature.asc
Description: PGP signature
- [PATCH] Fix tests under Windows,
Peter Bex <=