1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
(**************************************************************************)
(* *)
(* The Why platform for program certification *)
(* Copyright (C) 2002-2008 *)
(* Romain BARDOU *)
(* Jean-Franois COUCHOT *)
(* Mehdi DOGGUY *)
(* Jean-Christophe FILLITRE *)
(* Thierry HUBERT *)
(* Claude MARCH *)
(* Yannick MOY *)
(* Christine PAULIN *)
(* Yann RGIS-GIANAS *)
(* Nicolas ROUSSET *)
(* Xavier URBAIN *)
(* *)
(* This software is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU General Public *)
(* License version 2, as published by the Free Software Foundation. *)
(* *)
(* This software is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *)
(* *)
(* See the GNU General Public License version 2 for more details *)
(* (enclosed in the file GPL). *)
(* *)
(**************************************************************************)
open Format
open Unix
let usage_string = "cadlog [options] file"
let usage () =
eprintf "usage: %s@." usage_string;
exit 1
let file = ref ""
let def_file s =
if !file="" then file := s
else usage ()
let jessie = ref false
let krakatoa = ref false
let _ =
Arg.parse
[ "-jc", Arg.Set jessie, " Jessie bench";
"-java", Arg.Set krakatoa, " Krakatoa bench";
]
def_file usage_string
let file = if !file ="" then usage() else !file
let c = open_out file
let fmt = formatter_of_out_channel c
let tool =
if !jessie then "Jessie" else
if !krakatoa then "Krakatoa" else
"Caduceus"
let version,date =
if !jessie then Jc_version.version, Jc_version.date else
if !krakatoa then Java_version.version, Java_version.date else
Cversion.version, Cversion.date
let d,m,y =
let tm = localtime (time ()) in
tm.tm_mday, 1+tm.tm_mon, 1900+tm.tm_year
let () =
fprintf fmt "%8s version : %s@." tool version;
fprintf fmt "%8s compilation date: %s@." tool date;
fprintf fmt "Bench execution date : %d/%d/%d@." d m y;
try
while true do
let s = read_line () in
print_endline s;
fprintf fmt "%s@." s
done
with End_of_file ->
close_out c
|