mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -05:00
Fix in filenames during bench log parsing
This commit is contained in:
parent
d52c6d7965
commit
be4ce92d08
3 changed files with 18 additions and 5 deletions
|
|
@ -135,6 +135,12 @@ let print_diff_short s1 s2 =
|
|||
| [] -> ()
|
||||
| l -> Format.printf "WARNING : %d incoherence@\n" (List.length l)
|
||||
|
||||
let print_full h =
|
||||
let aux f pb =
|
||||
()
|
||||
in
|
||||
Hashtbl.iter aux h
|
||||
|
||||
(* Main function *)
|
||||
let main () =
|
||||
Arg.parse args anon usage;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,10 @@ type pb = {
|
|||
pb_time : float;
|
||||
}
|
||||
|
||||
let str_cut s start len =
|
||||
try String.sub s start len
|
||||
with Invalid_argument _ -> ""
|
||||
|
||||
let status_of_lines f = function
|
||||
| ["Sat"] -> Sat
|
||||
| ["Unsat"] -> Unsat
|
||||
|
|
@ -77,7 +81,7 @@ let status_of_lines f = function
|
|||
List.iter (fun s -> Format.printf "%s@." s) l;
|
||||
raise (Unknown_status (f, l))
|
||||
|
||||
let parse_raw f =
|
||||
let parse_raw base f =
|
||||
let f_in = open_in f in
|
||||
let f_lines = ref [] in
|
||||
begin try
|
||||
|
|
@ -92,14 +96,18 @@ let parse_raw f =
|
|||
| [] -> raise (Empty_raw f)
|
||||
| s :: r ->
|
||||
let st = status_of_lines f (List.rev r) in
|
||||
{ pb_name = f; pb_st = st; pb_time = float_of_string s }
|
||||
assert (str_cut f 0 (String.length base) = base);
|
||||
let file_name = String.sub f (String.length base) (String.length f - String.length base) in
|
||||
{ pb_name = file_name; pb_st = st; pb_time = float_of_string s }
|
||||
|
||||
let parse_commit root =
|
||||
let l = list_dir_files_rec (Filename.concat root "raw") in
|
||||
let s = Filename.concat root "raw" in
|
||||
let l = list_dir_files_rec s in
|
||||
let res = Hashtbl.create (List.length l) in
|
||||
List.iter (fun f ->
|
||||
try
|
||||
Hashtbl.add res f (parse_raw f)
|
||||
let pb = parse_raw s f in
|
||||
Hashtbl.add res pb.pb_name pb
|
||||
with Empty_raw _ | Unknown_status _ -> ()
|
||||
) l;
|
||||
res
|
||||
|
|
|
|||
|
|
@ -11,5 +11,4 @@ val last_commit : unit -> string
|
|||
type status = Sat | Unsat | Timeout | Spaceout
|
||||
type pb = { pb_name : string; pb_st : status; pb_time : float; }
|
||||
|
||||
val parse_raw : string -> pb
|
||||
val parse_commit : string -> (string, pb) Hashtbl.t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue