The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #14435 from kit-ty-kate/testsuite-not_root

Disable the lib-runtime-events/test_create_cursor_failures.ml test when the current user is a superuser

authored by

Gabriel Scherer and committed by
GitHub
c7574991 caf76f3b

+16
+4
Changes
··· 479 479 - #13224: Clarify barriers and spin macros with delayed expansion. 480 480 (Antonin Décimo, review by David Allsopp and Gabriel Scherer) 481 481 482 + - #14435: Add the not-root builtin ocamltest action. This allows to skip 483 + tests that fail if the current user is root (superuser). 484 + (Kate Deplaix, review by Gabriel Scherer and Nicolás Ojeda Bär) 485 + 482 486 ### Build system: 483 487 484 488 - #13705: Cache test results of custom Autoconf tests from aclocal.m4.
+8
ocamltest/builtin_actions.ml
··· 305 305 "symlinks available" 306 306 "symlinks not available") 307 307 308 + let not_root = make 309 + ~name:"not-root" 310 + ~description:"Skip test if the current user is root" 311 + (Actions_helpers.pass_or_skip (Unix.getuid () <> 0) 312 + "current user is not root" 313 + "current user is root") 314 + 308 315 let setup_build_env = make 309 316 ~name:"setup-build-env" 310 317 ~description:"Create a dedicated directory for the test and populates it" ··· 426 433 arch32; 427 434 arch64; 428 435 has_symlink; 436 + not_root; 429 437 setup_build_env; 430 438 setup_simple_build_env; 431 439 run;
+1
ocamltest/ocamltest_unix.mli
··· 19 19 val symlink : ?to_dir:bool -> string -> string -> unit 20 20 val chmod : string -> int -> unit 21 21 val gettimeofday : unit -> float 22 + val getuid : unit -> int
+1
ocamltest/ocamltest_unix_real.ml
··· 15 15 (* Unix.gettimeofday and Unix.has_symlink never raise *) 16 16 let has_symlink = Unix.has_symlink 17 17 let gettimeofday = Unix.gettimeofday 18 + let getuid = Unix.getuid 18 19 19 20 (* Convert Unix_error to Sys_error *) 20 21 let wrap f x =
+2
testsuite/tests/lib-runtime-events/test_create_cursor_failures.ml
··· 2 2 include unix; 3 3 include runtime_events; 4 4 hasunix; 5 + not-root; 5 6 { 6 7 bytecode; 7 8 }{ ··· 33 34 34 35 (* force failure of [create_cursor None] *) 35 36 let make_unreadable () = 37 + (* NOTE: Only works if the current user isn't root *) 36 38 Unix.chmod (Option.get (Runtime_events.path())) 0o000 37 39 38 40 let () =