Commit 0b182b5e authored by Erwan Jahier's avatar Erwan Jahier
Browse files

lurette perso.5 Mon, 05 Nov 2001 15:03:57 +0100 by jahier

Parent-Version:      perso.4
Version-Log:         empty
Project-Description: Lurette
parent 2c1c9dc6
......@@ -10,11 +10,12 @@
(env.ml 21601 1004539865 16_env.ml 1.4)
(Mercury/test.aut 1231 1002546062 8_test2.aut 1.1)
(doc/Interface_draft 5232 1003928781 19_Interface_ 1.1)
(make_lurette 1010 1004969037 27_make_luret 1.1)
(Mercury/Mmakefile 102 1002789994 1_Mmakefile 1.3)
(doc/archi.fig 3693 1003928781 20_archi.fig 1.1)
(Makefile 212 1004539865 18_Makefile 1.2)
(interface/generate_lurette_interface.ml 10959 1004543174 24_generate_l 1.3)
(interface/Makefile 127 1004519854 25_Makefile 1.1)
(Makefile 295 1004969037 18_Makefile 1.4)
(interface/generate_lurette_interface.ml 12207 1004969037 24_generate_l 1.5)
(interface/Makefile 132 1004969037 25_Makefile 1.2)
(OcamlMakefile 15015 1004519854 17_OcamlMakef 1.2)
(interface/TAGS 608 1004519854 26_TAGS 1.1)
(README 0 1002791390 10_README 1.1)
......@@ -25,5 +26,5 @@
(graph.mli 1305 1003932490 13_graph.mli 1.2)
(graph.ml 2397 1003932490 14_graph.ml 1.2)
(lurette.mli 514 1003928781 11_lurette.ml 1.1)
(TAGS 4544 1004539865 21_TAGS 1.3)
(lurette.ml 780 1004543174 12_lurette.ml 1.3)
(TAGS 4544 1004547252 21_TAGS 1.4)
(lurette.ml 990 1004547252 12_lurette.ml 1.4)
OCAMLMAKEFILE = ./OcamlMakefile
SOURCES = edge.c \
-include lurette.in
SOURCES = $(SUT) \
sut_stub.c sut_idl_stub.idl \
$(ORACLE) \
oracle_stub.c oracle_idl_stub.idl \
graph.mli graph.ml env.mli env.ml lurette.mli lurette.ml
RESULT = lurette
......
OCAMLMAKEFILE = ../OcamlMakefile
SOURCES = generate_lurette_interface.ml
RESULT = geni
RESULT = gen_stubs
LIBS = str
-include $(OCAMLMAKEFILE)
......@@ -173,7 +173,7 @@ let (generate_stub_c : module_name -> string -> input_vars -> output_vars -> uni
fun mod_name str vi vo ->
let oc = open_out (str ^ "_stub.c") in
let put s = output_string oc s in
let ov = rev vo in
let ov = List.rev vo in
let (lo_t, lo_v) = List.hd ov in
let vo_pre = List.tl ov in
......@@ -268,7 +268,7 @@ let (generate_idl : module_name -> string -> typedef_alias -> input_vars -> outp
fun mod_name str type_alias vi vo ->
let oc = open_out (str ^ "_idl_stub.idl") in
let put s = output_string oc s in
let ov = rev vo in
let ov = List.rev vo in
let (lo_t, lo_v) = List.hd ov in
let vo_pre = List.tl ov in
......@@ -307,12 +307,31 @@ let (generate_idl : module_name -> string -> typedef_alias -> input_vars -> outp
(****************************************************************************)
(****************************************************************************)
(****************************************************************************)
let usage _ = print_string
("usage: gen_stub <sut> <oracle> \n\twhere <sut> (reps <oracle>)" ^
" is the name of the System Under Test C file\n\t(resp the " ^
"oracle file) without its extension.\n ")
let (main : unit -> 'a) =
fun () ->
let (m, vi, vo) = read_pragma_in_c_file "edge.h" in
let alias = read_typedef "edge.h" in
generate_stub_c m "sut" vi vo ;
generate_idl m "sut" alias vi vo
try
let sut_h = (Sys.argv.(1) ^ ".h") in
let oracle_h = (Sys.argv.(2) ^ ".h") in
let (sut_m, sut_vi, sut_vo) = read_pragma_in_c_file sut_h in
let sut_alias = read_typedef sut_h in
let (oracle_m, oracle_vi, oracle_vo) = read_pragma_in_c_file oracle_h in
let oracle_alias = read_typedef oracle_h in
generate_stub_c sut_m "sut" sut_vi sut_vo ;
generate_idl sut_m "sut" sut_alias sut_vi sut_vo ;
generate_stub_c oracle_m "oracle" oracle_vi oracle_vo ;
generate_idl oracle_m "oracle" oracle_alias oracle_vi oracle_vo
with
Invalid_argument("Array.get") -> usage ()
| Sys_error(errMsg) -> (print_string ("*** " ^ errMsg ^ "\n")) ; usage ()
;;
main ();;
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette perso 4)
(Parent-Version lurette perso 3)
(Version-Log "
Cette fois ci, ca marche vraimet !!
")
(Project-Version lurette perso 5)
(Parent-Version lurette perso 4)
(Version-Log "")
(New-Version-Log "")
(Checkin-Time "Wed, 31 Oct 2001 16:54:12 +0000")
(Checkin-Time "Mon, 05 Nov 2001 14:03:57 +0000")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -28,12 +26,12 @@ Cette fois ci, ca marche vraimet !!
(env.ml (lurette/16_env.ml 1.4 644))
(interface/generate_lurette_interface.mli (lurette/23_generate_l 1.1 644))
(interface/generate_lurette_interface.ml (lurette/24_generate_l 1.4 644))
(interface/generate_lurette_interface.ml (lurette/24_generate_l 1.5 644))
;; Make files
(OcamlMakefile (lurette/17_OcamlMakef 1.2 644))
(Makefile (lurette/18_Makefile 1.3 644))
(interface/Makefile (lurette/25_Makefile 1.1 644))
(Makefile (lurette/18_Makefile 1.4 644))
(interface/Makefile (lurette/25_Makefile 1.2 644))
;; Documentation
......@@ -65,6 +63,11 @@ Cette fois ci, ca marche vraimet !!
; I have added graph__arc_content in the interface of this library module
(Mercury/graph.m (lurette/7_graph.m 1.1 644))
;; Files added by populate at Mon, 05 Nov 2001 14:16:21 +0100,
;; to version perso.4(w), by jahier:
(make_lurette (lurette/27_make_luret 1.1 744))
)
(Merge-Parents)
(New-Merge-Parents)
#! /bin/sh
#
# XXX should be an ocaml script for portability ...
Help="\
The first and second args of this scripts are respectively the name
of the sut and the name of the oracle modules (no extension).
1) It call `gen_stubs $1 $2' which generates the stub files to
interface the C (poc) file implementing the sut and the oracle with
the rest of the lurette system (which is emplemented in ocaml).
2) It generatesa file named `lurette.in' which is included in the
Makefile (which defines the name if the sut and the oracle).
3) Then it calls `make'.
"
case $# in
2)
############################
echo ... Generating the stub files: gen_stubs $1 $2
./interface/gen_stubs $1 $2
############################
echo "... generates the lurette.in file (which is included in the Makefile) "
rm -f lurette.in
cat << EOF >> lurette.in
SUT = $1.c
ORACLE = $2.c
export SUT
export ORACLE
EOF
############################
echo "... Making lurette: make"
make
;;
*)
echo "$Help"
exit 0
;;
esac
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment