Skip to content

Commit eb8fe3e

Browse files
authored
Check if windows has_symlink for tests (#771)
Symlinking is privileged operation on Windows, so we check if the running user can make symlinks before running tests that require them.
1 parent debe356 commit eb8fe3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib_eio_windows/test/test_fs.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ let test_symlink env () =
158158
Unix.mkdir "another" 0o700;
159159
print_endline @@ Unix.realpath "to-subdir" |}
160160
*)
161+
if not (Unix.has_symlink ()) then
162+
Printf.printf "Skipping test_symlink on systems that don't support symlinks.\n"
163+
else
161164
let cwd = Eio.Stdenv.cwd env in
162165
try_mkdir (cwd / "sandbox");
163166
Unix.symlink ~to_dir:true ".." "sandbox\\to-root";
@@ -277,4 +280,5 @@ let tests env = [
277280
"unlink", `Quick, test_unlink env;
278281
"failing-unlink", `Quick, try_failing_unlink env;
279282
"rmdir", `Quick, test_remove_dir env;
283+
"mkdirs", `Quick, test_mkdirs env;
280284
]

0 commit comments

Comments
 (0)