2018-02-26 07:49:24 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Sebastien Hinderer, projet Gallium, INRIA Paris *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 2018 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. This file is distributed under the terms of *)
|
|
|
|
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
|
|
(* special exception on linking described in the file LICENSE. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
(* Descriptions of the OCaml tools *)
|
|
|
|
|
2018-02-27 01:12:17 -08:00
|
|
|
open Ocamltest_stdlib
|
|
|
|
|
2018-02-26 07:49:24 -08:00
|
|
|
class tool
|
2020-05-20 22:16:03 -07:00
|
|
|
~(name : string)
|
2018-02-27 08:15:23 -08:00
|
|
|
~(family : string)
|
2018-02-26 07:49:24 -08:00
|
|
|
~(flags : string)
|
|
|
|
~(directory : string)
|
|
|
|
~(exit_status_variable : Variables.t)
|
|
|
|
~(reference_variable : Variables.t)
|
|
|
|
~(output_variable : Variables.t)
|
2018-02-27 01:12:17 -08:00
|
|
|
= object (self)
|
2018-02-26 07:49:24 -08:00
|
|
|
method name = name
|
2018-02-27 08:15:23 -08:00
|
|
|
method family = family
|
2018-02-26 07:49:24 -08:00
|
|
|
method flags = flags
|
|
|
|
method directory = directory
|
|
|
|
method exit_status_variable = exit_status_variable
|
|
|
|
method reference_variable = reference_variable
|
|
|
|
method output_variable = output_variable
|
2018-02-27 01:12:17 -08:00
|
|
|
|
|
|
|
method reference_filename_suffix env =
|
|
|
|
let tool_reference_suffix =
|
|
|
|
Environments.safe_lookup Ocaml_variables.compiler_reference_suffix env
|
|
|
|
in
|
|
|
|
if tool_reference_suffix<>""
|
|
|
|
then tool_reference_suffix ^ ".reference"
|
|
|
|
else ".reference"
|
|
|
|
|
|
|
|
method reference_file env prefix =
|
|
|
|
let suffix = self#reference_filename_suffix env in
|
|
|
|
(Filename.make_filename prefix directory) ^ suffix
|
2018-02-26 07:49:24 -08:00
|
|
|
end
|
2018-02-27 01:12:17 -08:00
|
|
|
|
|
|
|
let expected_exit_status env tool =
|
2018-02-28 07:24:46 -08:00
|
|
|
Actions_helpers.exit_status_of_variable env tool#exit_status_variable
|
2018-03-05 02:09:57 -08:00
|
|
|
|
|
|
|
|
|
|
|
let ocamldoc =
|
|
|
|
object inherit
|
|
|
|
tool
|
|
|
|
~name:Ocaml_files.ocamldoc
|
|
|
|
~family:"doc"
|
|
|
|
~flags:""
|
|
|
|
~directory:"ocamldoc"
|
|
|
|
~exit_status_variable:Ocaml_variables.ocamldoc_exit_status
|
|
|
|
~reference_variable:Ocaml_variables.ocamldoc_reference
|
|
|
|
~output_variable:Ocaml_variables.ocamldoc_output
|
|
|
|
|
|
|
|
method ! reference_filename_suffix env =
|
|
|
|
let backend =
|
|
|
|
Environments.safe_lookup Ocaml_variables.ocamldoc_backend env in
|
|
|
|
if backend = "" then
|
|
|
|
".reference"
|
|
|
|
else "." ^ backend ^ ".reference"
|
|
|
|
end
|