From eb8fe3ef822ea36aa54b432f15534037e2ab0c02 Mon Sep 17 00:00:00 2001 From: Onah_Anthony <124398763+create2000@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:42:36 +0100 Subject: [PATCH] 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. --- lib_eio_windows/test/test_fs.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_eio_windows/test/test_fs.ml b/lib_eio_windows/test/test_fs.ml index 75435927b..9140d64d6 100755 --- a/lib_eio_windows/test/test_fs.ml +++ b/lib_eio_windows/test/test_fs.ml @@ -158,6 +158,9 @@ let test_symlink env () = Unix.mkdir "another" 0o700; print_endline @@ Unix.realpath "to-subdir" |} *) + if not (Unix.has_symlink ()) then + Printf.printf "Skipping test_symlink on systems that don't support symlinks.\n" + else let cwd = Eio.Stdenv.cwd env in try_mkdir (cwd / "sandbox"); Unix.symlink ~to_dir:true ".." "sandbox\\to-root"; @@ -277,4 +280,5 @@ let tests env = [ "unlink", `Quick, test_unlink env; "failing-unlink", `Quick, try_failing_unlink env; "rmdir", `Quick, test_remove_dir env; + "mkdirs", `Quick, test_mkdirs env; ] \ No newline at end of file