Ignore:
Timestamp:
Feb 7, 2012, 6:01:43 PM (9 years ago)
Author:
ayache
Message:

Frama-C plug-in (sources+documentation)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D5.1-5.3/cost-plug-in/wrapper/main.ml

    r1462 r1679  
    138138          (print_verbose1 "Done.\n" ;
    139139           Printf.printf
    140              "The cost of the %s function is at most %s (not verified).\n%!"
     140             "WCET of %s: %s (not verified).\n%!"
    141141             fun_name cost ;
    142142           (fun_name, cost))
    143143        else aux ()
    144144      else error ("Bad format of result file " ^ filename ^ ".")
    145     with End_of_file -> error "No step function found." in
     145    with End_of_file ->
     146      error "No step function found or its cost could not be computed." in
    146147  aux ()
    147148
     
    168169  let success_msg = "Done. Results are in file " ^ res_file ^ "." in
    169170  exec cmd error_callback error_msg success_callback success_msg
     171
     172let string_starts_with prefix s =
     173  let l = String.length prefix in
     174  (l <= String.length s) && (String.sub s 0 l = prefix)
    170175
    171176let read_jessie_results filename =
     
    179184        let rec aux () =
    180185          let s = input_line ic in
    181           let string_dpoints = "   :  " in
    182           let string_total = "total" ^ string_dpoints in
    183           let string_valid = "valid" ^ string_dpoints in
    184           let length_total = String.length string_total in
    185           let regexp = Str.regexp ("^" ^ string_total ^ "[0-9]+$") in
    186           if Str.string_match regexp s 0 then
    187             let total =
    188               String.sub s length_total ((String.length s) - length_total) in
    189             let s = input_line ic in
    190             let s_compare = string_valid ^ total in
    191             if String.length s >= String.length s_compare &&
    192               String.sub s 0 (String.length s_compare) = s_compare then
     186          if string_starts_with "valid" s then
     187            let regexp = Str.regexp (".*100%.*") in
     188            if Str.string_match regexp s 0 then
    193189              (print_verbose1 "Done.\n" ;
    194                Printf.printf "Result is proven correct.\n%!")
     190               Printf.printf "WCET is proven correct.\n%!")
    195191            else print_failed ()
    196192          else aux () in
Note: See TracChangeset for help on using the changeset viewer.