Skip to content
Snippets Groups Projects
Commit 8793ce95 authored by Virgile Prevosto's avatar Virgile Prevosto Committed by Andre Maroneze
Browse files

[mdr] put all Eva dependencies in a single file

parent a94e293c
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ PLUGIN_HAS_META:=yes ...@@ -36,7 +36,7 @@ PLUGIN_HAS_META:=yes
PLUGIN_GENERATED:=$(PLUGIN_DIR)/Markdown_report.mli PLUGIN_GENERATED:=$(PLUGIN_DIR)/Markdown_report.mli
PLUGIN_CMO:=\ PLUGIN_CMO:=\
sarif mdr_params parse_remarks \ sarif mdr_params parse_remarks \
eva_coverage md_gen sarif_gen mdr_register eva_info md_gen sarif_gen mdr_register
PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE) PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLE)
PLUGIN_REQUIRES:=ppx_deriving ppx_deriving_yojson yojson PLUGIN_REQUIRES:=ppx_deriving ppx_deriving_yojson yojson
PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure share/acsl.xml PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure share/acsl.xml
......
...@@ -35,6 +35,8 @@ m4_ifndef([FRAMAC_M4_MACROS], ...@@ -35,6 +35,8 @@ m4_ifndef([FRAMAC_M4_MACROS],
check_plugin(mdr,PLUGIN_RELATIVE_PATH(plugin_file),[Markdown/SARIF report plug-in],yes) check_plugin(mdr,PLUGIN_RELATIVE_PATH(plugin_file),[Markdown/SARIF report plug-in],yes)
plugin_use(mdr,eva)
plugin_require_pkg(mdr,ppx_deriving) plugin_require_pkg(mdr,ppx_deriving)
plugin_require_pkg(mdr,ppx_deriving_yojson) plugin_require_pkg(mdr,ppx_deriving_yojson)
......
...@@ -184,7 +184,9 @@ let nb_fundefs () = ...@@ -184,7 +184,9 @@ let nb_fundefs () =
is_analyzed_function (Kernel_function.get_vi kf) is_analyzed_function (Kernel_function.get_vi kf)
then nb + 1 else nb) 0 then nb + 1 else nb) 0
let md_gen () = open Markdown
let coverage_md_gen () =
let main = Kernel.MainFunction.get () in let main = Kernel.MainFunction.get () in
!Db.Value.compute (); !Db.Value.compute ();
let vis = new eva_coverage_vis ~from_entry_point:false in let vis = new eva_coverage_vis ~from_entry_point:false in
...@@ -227,4 +229,10 @@ let md_gen () = ...@@ -227,4 +229,10 @@ let md_gen () =
(float_of_int stats.covered_stmts *. 100. /. (float_of_int stats.covered_stmts *. 100. /.
float_of_int stats.total_stmts) float_of_int stats.total_stmts)
in in
Markdown.([ Block [Text summary_whole]; Block [Text summary ]]) [ Block [Text summary_whole]; Block [Text summary ]]
let domains_md_gen () =
let eva_domains = Eva.Value_parameters.enabled_domains () in
let domains = List.filter (fun (name, _) -> name <> "cvalue") eva_domains in
let aux (name, descr) = (plain "domain" @ bold name), plain descr in
List.map aux domains
...@@ -20,5 +20,8 @@ ...@@ -20,5 +20,8 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
(** generates a coverage summary of EVA's run*) (** generates a coverage summary of Eva's run*)
val md_gen: unit -> Markdown.element list val coverage_md_gen: unit -> Markdown.elements
(** generates a summary of activated Eva domains. *)
val domains_md_gen: unit -> (Markdown.text * Markdown.text) list
...@@ -49,12 +49,6 @@ let plural l s = ...@@ -49,12 +49,6 @@ let plural l s =
| [] | [ _ ] -> s | [] | [ _ ] -> s
| _::_::_ -> s ^ "s" | _::_::_ -> s ^ "s"
let get_eva_domains () =
let eva_domains = Eva.Value_parameters.enabled_domains () in
let domains = List.filter (fun (name, _) -> name <> "cvalue") eva_domains in
let aux (name, descr) = (plain "domain" @ bold name), plain descr in
List.map aux domains
let section_domains env = let section_domains env =
let anchor = "domains" in let anchor = "domains" in
let head = H3 (plain "Eva Domains", Some anchor) in let head = H3 (plain "Eva Domains", Some anchor) in
...@@ -63,7 +57,7 @@ let section_domains env = ...@@ -63,7 +57,7 @@ let section_domains env =
:: Comment "You can give more information about the choice of Eva domains" :: Comment "You can give more information about the choice of Eva domains"
:: insert_marks env anchor :: insert_marks env anchor
else begin else begin
let l = get_eva_domains () in let l = Eva_info.domains_md_gen () in
head head
:: Block :: Block
(match l with (match l with
...@@ -271,7 +265,7 @@ let gen_context env = ...@@ -271,7 +265,7 @@ let gen_context env =
let gen_coverage env = let gen_coverage env =
let anchor = "coverage" in let anchor = "coverage" in
let header = H1 (plain "Coverage", Some anchor) in let header = H1 (plain "Coverage", Some anchor) in
let content = Eva_coverage.md_gen () in let content = Eva_info.coverage_md_gen () in
let content = let content =
if env.is_draft then if env.is_draft then
content @ content @
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment