···479479- #13224: Clarify barriers and spin macros with delayed expansion.
480480 (Antonin Décimo, review by David Allsopp and Gabriel Scherer)
481481482482+- #14435: Add the not-root builtin ocamltest action. This allows to skip
483483+ tests that fail if the current user is root (superuser).
484484+ (Kate Deplaix, review by Gabriel Scherer and Nicolás Ojeda Bär)
485485+482486### Build system:
483487484488- #13705: Cache test results of custom Autoconf tests from aclocal.m4.
+8
ocamltest/builtin_actions.ml
···305305 "symlinks available"
306306 "symlinks not available")
307307308308+let not_root = make
309309+ ~name:"not-root"
310310+ ~description:"Skip test if the current user is root"
311311+ (Actions_helpers.pass_or_skip (Unix.getuid () <> 0)
312312+ "current user is not root"
313313+ "current user is root")
314314+308315let setup_build_env = make
309316 ~name:"setup-build-env"
310317 ~description:"Create a dedicated directory for the test and populates it"
···426433 arch32;
427434 arch64;
428435 has_symlink;
436436+ not_root;
429437 setup_build_env;
430438 setup_simple_build_env;
431439 run;
+1
ocamltest/ocamltest_unix.mli
···1919val symlink : ?to_dir:bool -> string -> string -> unit
2020val chmod : string -> int -> unit
2121val gettimeofday : unit -> float
2222+val getuid : unit -> int
+1
ocamltest/ocamltest_unix_real.ml
···1515(* Unix.gettimeofday and Unix.has_symlink never raise *)
1616let has_symlink = Unix.has_symlink
1717let gettimeofday = Unix.gettimeofday
1818+let getuid = Unix.getuid
18191920(* Convert Unix_error to Sys_error *)
2021let wrap f x =
···22 include unix;
33 include runtime_events;
44 hasunix;
55+ not-root;
56 {
67 bytecode;
78 }{
···33343435(* force failure of [create_cursor None] *)
3536let make_unreadable () =
3737+ (* NOTE: Only works if the current user isn't root *)
3638 Unix.chmod (Option.get (Runtime_events.path())) 0o000
37393840let () =