Skip to content
Snippets Groups Projects
Commit e9236e69 authored by Valentin Perrelle's avatar Valentin Perrelle Committed by David Bühler
Browse files

[Tests] Use the new Eva API

parent 37b034cd
No related branches found
No related tags found
No related merge requests found
...@@ -206,7 +206,7 @@ let run typ expr = ...@@ -206,7 +206,7 @@ let run typ expr =
end; end;
File.prepare_cil_file cil; File.prepare_cil_file cil;
Kernel.MainFunction.set "f"; Kernel.MainFunction.set "f";
!Db.Value.compute (); Eva.Analysis.compute ();
let kf = Globals.Functions.find_by_name "f" in let kf = Globals.Functions.find_by_name "f" in
let r = Globals.Vars.find_from_astinfo "result" Cil_types.VGlobal in let r = Globals.Vars.find_from_astinfo "result" Cil_types.VGlobal in
let ret = Kernel_function.find_return kf in let ret = Kernel_function.find_return kf in
......
let main () = let main () =
!Db.Value.compute (); Eva.Analysis.compute ();
Globals.set_entry_point "main2" false; Globals.set_entry_point "main2" false;
!Db.Value.compute (); Eva.Analysis.compute ();
;; ;;
let () = Db.Main.extend main let () = Db.Main.extend main
...@@ -7,7 +7,7 @@ let run () = ...@@ -7,7 +7,7 @@ let run () =
(fun kf -> (fun kf ->
if not (Cil_builtins.is_builtin (Kernel_function.get_vi kf)) then begin if not (Cil_builtins.is_builtin (Kernel_function.get_vi kf)) then begin
Globals.set_entry_point (Kernel_function.get_name kf) true; Globals.set_entry_point (Kernel_function.get_name kf) true;
!Db.Value.compute(); Eva.Analysis.compute();
let hyps = let hyps =
Alarms.fold Alarms.fold
(fun _ kf' s ~rank:_ _ a l -> (fun _ kf' s ~rank:_ _ a l ->
......
...@@ -2,7 +2,7 @@ open Cil_types ...@@ -2,7 +2,7 @@ open Cil_types
let run () = let run () =
Dynamic.Parameter.Bool.set "-eva-context-valid-pointers" true; Dynamic.Parameter.Bool.set "-eva-context-valid-pointers" true;
!Db.Value.compute (); Eva.Analysis.compute ();
Globals.Functions.iter Globals.Functions.iter
(fun kf -> (fun kf ->
let kf_name = Kernel_function.get_name kf in let kf_name = Kernel_function.get_name kf in
......
...@@ -6,10 +6,10 @@ let ptest_file = ...@@ -6,10 +6,10 @@ let ptest_file =
with Not_found -> fun dir file -> dir ^ file with Not_found -> fun dir file -> dir ^ file
let main () = let main () =
!Db.Value.compute (); Eva.Analysis.compute ();
Dynamic.Parameter.String.set "" ""; Dynamic.Parameter.String.set "" "";
Dynamic.Parameter.String.set "" (ptest_file "tests/misc/" "issue109.i"); Dynamic.Parameter.String.set "" (ptest_file "tests/misc/" "issue109.i");
File.init_from_cmdline (); File.init_from_cmdline ();
!Db.Value.compute () Eva.Analysis.compute ()
let main = Db.Main.extend main let main = Db.Main.extend main
...@@ -8,9 +8,9 @@ let run () = ...@@ -8,9 +8,9 @@ let run () =
~last:false ~last:false
"default" "default"
in in
!Db.Value.compute (); Eva.Analysis.compute ();
Project.set_current p_default; Project.set_current p_default;
!Db.Value.compute (); Eva.Analysis.compute ();
() ()
let () = Db.Main.extend run let () = Db.Main.extend run
let main () = let main () =
!Db.Value.compute(); Eva.Analysis.compute();
Filecheck.check_ast "Check alarm"; Filecheck.check_ast "Check alarm";
File.pretty_ast () File.pretty_ast ()
......
...@@ -18,13 +18,13 @@ let main () = ...@@ -18,13 +18,13 @@ let main () =
Project.save fp; Project.save fp;
Project.remove ~project:p (); Project.remove ~project:p ();
let p = Project.load fp in let p = Project.load fp in
Project.on p (fun () -> !Db.Value.compute (); ignore (sparecode ())) () Project.on p (fun () -> Eva.Analysis.compute (); ignore (sparecode ())) ()
let () = Db.Main.extend main let () = Db.Main.extend main
(* testing Project.create_by_copy *) (* testing Project.create_by_copy *)
let main2 () = let main2 () =
!Db.Value.compute (); Eva.Analysis.compute ();
let prj = Project.create_by_copy ~last:false "copy" in let prj = Project.create_by_copy ~last:false "copy" in
Format.printf "INIT AST@."; Format.printf "INIT AST@.";
File.pretty_ast (); File.pretty_ast ();
......
...@@ -63,7 +63,7 @@ let main _ = ...@@ -63,7 +63,7 @@ let main _ =
Cil.visitCilFile infos new_cil_file (* the cil file after slicing *);; Cil.visitCilFile infos new_cil_file (* the cil file after slicing *);;
*) *)
Dynamic.Parameter.Bool.set "-eva-show-progress" true; Dynamic.Parameter.Bool.set "-eva-show-progress" true;
!Db.Value.compute (); Eva.Analysis.compute ();
let all = Cil_datatype.Fundec.Set.empty in let all = Cil_datatype.Fundec.Set.empty in
let proj3 = Constant_Propagation.Api.get all ~cast_intro:true in let proj3 = Constant_Propagation.Api.get all ~cast_intro:true in
Project.set_current proj3; Project.set_current proj3;
......
...@@ -64,7 +64,7 @@ let load_source_file ?entry_point filename = ...@@ -64,7 +64,7 @@ let load_source_file ?entry_point filename =
in in
ignore (Db.get_cil_file ()); ignore (Db.get_cil_file ());
let kf = Db.find_function_def_by_name entry_point in let kf = Db.find_function_def_by_name entry_point in
ignore (!Db.Value.compute_entry_point kf ~library); ignore (Eva.Analysis.compute_entry_point kf ~library);
Db.iter_on_functions Db.iter_on_functions
(fun kf -> if Db.is_definition kf && Db.Value.is_called kf (fun kf -> if Db.is_definition kf && Db.Value.is_called kf
then !Db.From.compute kf) then !Db.From.compute kf)
......
...@@ -72,7 +72,7 @@ let main () = ...@@ -72,7 +72,7 @@ let main () =
); );
Project.on p (fun () -> Project.on p (fun () ->
Dynamic.Parameter.Bool.set "-eva-show-progress" true; Dynamic.Parameter.Bool.set "-eva-show-progress" true;
!Db.Value.compute () Eva.Analysis.compute ()
) (); ) ();
File.pretty_ast ~prj:p () File.pretty_ast ~prj:p ()
......
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