Skip to content

Commit

Permalink
Update the installation test for ld.conf-relative
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Oct 15, 2024
1 parent 97aae47 commit 2f798ff
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions tools/test_install.ml
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ let print_process_status () = function
module Environment : sig
type t

val make :
?caml_ld_library_path:bool -> ?ocamllib:bool -> string -> string -> t
val make : ?ocamllib:bool -> string -> string -> t

val run_process :
'a output
Expand All @@ -315,7 +314,6 @@ end = struct
serial: int;
bindir: string;
libdir: string;
set_CAML_LD_LIBRARY_PATH: bool;
set_OCAMLLIB: bool;
}

Expand Down Expand Up @@ -352,7 +350,7 @@ end = struct
with effectively PATH=$bindir:$PATH and
LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH on Unix or
PATH=$bindir;$libdir;$PATH on Windows. *)
let make ?(caml_ld_library_path=false) ?(ocamllib=false) bindir libdir =
let make ?(ocamllib=false) bindir libdir =
let keep binding =
let equals = String.index binding '=' in
let name = String.sub binding 0 equals in
Expand Down Expand Up @@ -388,21 +386,14 @@ end = struct
else
bindings
in
let bindings =
if caml_ld_library_path then
("CAML_LD_LIBRARY_PATH=" ^ Filename.concat libdir "stublibs")::bindings
else
bindings
in
let env = Array.of_list bindings in
try {env; serial = Hashtbl.find environments env; bindir; libdir;
set_CAML_LD_LIBRARY_PATH = caml_ld_library_path;
set_OCAMLLIB = ocamllib}
with Not_found ->
let serial = Hashtbl.length environments + 1 in
Hashtbl.add environments env serial;
{env; serial; bindir; libdir;
set_CAML_LD_LIBRARY_PATH = caml_ld_library_path; set_OCAMLLIB = ocamllib}
set_OCAMLLIB = ocamllib}

type program =
| Direct of string
Expand Down Expand Up @@ -446,11 +437,6 @@ end = struct
@{<inline_code>> @} @{<hint>LD_LIBRARY_PATH@}=%a:$LD_LIBRARY_PATH\n"
display_path environment.bindir
display_path environment.libdir;
if environment.set_CAML_LD_LIBRARY_PATH then
Format.printf "\
@{<inline_code>> @} @{<warning>CAML_LD_LIBRARY_PATH@}=\
%a/stublibs:$CAML_LD_LIBRARY_PATH\n"
display_path libdir;
if environment.set_OCAMLLIB then
Format.printf "\
@{<inline_code>> @} @{<warning>OCAMLLIB@}=%a:$OCAMLLIB\n" display_path libdir
Expand Down Expand Up @@ -934,7 +920,7 @@ let () =
let runtime = Some (exe (Filename.concat bindir "ocamlrun")) in
List.iter (fun f -> assert (f ?runtime env ~arg:false = None)) programs;
let env =
Environment.make ~caml_ld_library_path:true ~ocamllib:true bindir libdir in
Environment.make ~ocamllib:true bindir libdir in
Compmisc.reinit_path ~standard_library:libdir ();
let programs = run_tests ~full:false env bindir libdir config.libraries in
assert (programs = [])

0 comments on commit 2f798ff

Please sign in to comment.