Skip to content
Snippets Groups Projects
Commit 94445159 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Make sure lus2lic exits politely.

Indeed, otherwise, in some cases, rdbg or lurette migth not realise
that lus2lic exited in error.
parent cded720f
No related branches found
No related tags found
No related merge requests found
...@@ -46,5 +46,5 @@ Library "lustre-v6" ...@@ -46,5 +46,5 @@ Library "lustre-v6"
Install:true Install:true
XMETAEnable: true XMETAEnable: true
XMETADescription: an API to call the Lustre v6 interpreter from ocaml XMETADescription: an API to call the Lustre v6 interpreter from ocaml
InternalModules: SocExecValue,SocUtils,Lv6util,Lv6version,Lv6errors,Lxm,Lv6MainArgs,Verbose,Soc,SocPredef,Lv6Id,SocExec,SocExecEvalPredef,Compile,AstTab,AstTabSymbol,AstInstanciateModel,Lv6parserUtils,AstV6,FilenameExtras,LicTab,LicDump,AstPredef,Lic,AstCore,FreshName,IdSolver,EvalConst,LicEvalConst,LicEvalType,UnifyType,Ast2lic,AstV6Dump,EvalClock,UnifyClock,LicEvalClock,EvalType,LicPrg,LicMetaOp,L2lCheckOutputs,Misc,L2lRmPoly,L2lExpandMetaOp,L2lSplit,L2lExpandNodes,L2lExpandArrays,L2lCheckLoops,L2lCheckMemSafe,L2lOptimIte,Lv6lexer,Lv6parser,AstRecognizePredef,Lic2soc,Action,ActionsDeps,SocVar,Lus2licRun,SortActions,SortActionsExpe InternalModules: SocExecValue,SocUtils,Lv6util,Lv6version,Lv6errors,Lxm,Lv6MainArgs,Verbose,Soc,SocPredef,Lv6Id,SocExec,SocExecEvalPredef,Compile,AstTab,AstTabSymbol,AstInstanciateModel,Lv6parserUtils,AstV6,FilenameExtras,LicTab,LicDump,AstPredef,Lic,AstCore,FreshName,IdSolver,EvalConst,LicEvalConst,LicEvalType,UnifyType,Ast2lic,AstV6Dump,EvalClock,UnifyClock,LicEvalClock,EvalType,LicPrg,LicMetaOp,L2lCheckOutputs,Misc,L2lRmPoly,L2lExpandMetaOp,L2lSplit,L2lExpandNodes,L2lExpandArrays,L2lCheckLoops,L2lCheckMemSafe,L2lOptimIte,Lv6lexer,Lv6parser,AstRecognizePredef,Lic2soc,Action,ActionsDeps,SocVar,Lus2licRun,SortActions,SortActionsExpe,L2lCheckKcgKeyWord
# Comment se passer de cette liste à la Prevert ? # Comment se passer de cette liste à la Prevert ?
(* Time-stamp: <modified the 17/08/2015 (at 16:58) by Erwan Jahier> *)
(** Check that the inoput program does not use KCG keywords an ident *)
val doit : LicPrg.t -> unit
# OASIS_START # OASIS_START
# DO NOT EDIT (digest: 702371850d29477bd775b51a95b16417) # DO NOT EDIT (digest: dd8953705e3a6e5786f72d3409c5318b)
Lus2licRun Lus2licRun
SocExecValue SocExecValue
SocUtils SocUtils
...@@ -60,4 +60,5 @@ SocVar ...@@ -60,4 +60,5 @@ SocVar
Lus2licRun Lus2licRun
SortActions SortActions
SortActionsExpe SortActionsExpe
L2lCheckKcgKeyWord
# OASIS_STOP # OASIS_STOP
# OASIS_START # OASIS_START
# DO NOT EDIT (digest: 702371850d29477bd775b51a95b16417) # DO NOT EDIT (digest: dd8953705e3a6e5786f72d3409c5318b)
Lus2licRun Lus2licRun
SocExecValue SocExecValue
SocUtils SocUtils
...@@ -60,4 +60,5 @@ SocVar ...@@ -60,4 +60,5 @@ SocVar
Lus2licRun Lus2licRun
SortActions SortActions
SortActionsExpe SortActionsExpe
L2lCheckKcgKeyWord
# OASIS_STOP # OASIS_STOP
(* Time-stamp: <modified the 10/07/2015 (at 14:26) by Erwan Jahier> *) (* Time-stamp: <modified the 17/08/2015 (at 16:13) by Erwan Jahier> *)
(* (*
Le manager d'argument adapt de celui de lutin, plus joli Le manager d'argument adapt de celui de lutin, plus joli
N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global, N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global,
...@@ -111,7 +111,7 @@ let (make_opt : unit -> t) = ...@@ -111,7 +111,7 @@ let (make_opt : unit -> t) =
exec = false; exec = false;
gen_c = false; gen_c = false;
gen_wcet = false; gen_wcet = false;
rif = false; rif = false;
gen_ocaml = false; gen_ocaml = false;
precision = None; precision = None;
launch_cc = false; launch_cc = false;
......
(* Time-stamp: <modified the 08/07/2015 (at 17:55) by Erwan Jahier> *) (* Time-stamp: <modified the 17/08/2015 (at 16:14) by Erwan Jahier> *)
open Verbose open Verbose
open AstV6 open AstV6
...@@ -10,7 +10,11 @@ open Format ...@@ -10,7 +10,11 @@ open Format
open Lv6MainArgs open Lv6MainArgs
let my_exit opt i = let my_exit opt i =
if opt.rif || opt.print_interface then (output_string opt.oc "\nq\n"; flush opt.oc); if opt.rif || opt.print_interface then
output_string opt.oc "\nq\n"
else
output_string opt.oc "\nbye\n";
flush opt.oc;
close_out opt.oc; close_out opt.oc;
if Sys.file_exists opt.outfile then Sys.remove opt.outfile; if Sys.file_exists opt.outfile then Sys.remove opt.outfile;
exit i exit i
...@@ -27,7 +31,8 @@ let find_a_node opt = ...@@ -27,7 +31,8 @@ let find_a_node opt =
let name = let name =
try Filename.chop_extension (Filename.basename first_file) try Filename.chop_extension (Filename.basename first_file)
with _ -> with _ ->
print_string ("*** Error: '"^first_file^"' is a bad file name.\n"); exit 1 print_string ("*** Error: '"^first_file^"' is a bad file name.\n");
my_exit opt 1
in in
name name
...@@ -47,9 +52,9 @@ let (gen_rif_interface : LicPrg.t -> Lv6Id.idref option -> Lv6MainArgs.t -> unit ...@@ -47,9 +52,9 @@ let (gen_rif_interface : LicPrg.t -> Lv6Id.idref option -> Lv6MainArgs.t -> unit
let msk, zesoc = Lic2soc.f lic_prg nk in let msk, zesoc = Lic2soc.f lic_prg nk in
msk, zesoc, main_node msk, zesoc, main_node
) else ( ) else (
print_string ("Error: no node is specified.\n"); print_string ("Error: no node is specified.\nbye\n");
flush stdout; flush stdout;
exit 1 my_exit opt 2
) )
) )
| Some main_node -> | Some main_node ->
...@@ -87,9 +92,9 @@ let (gen_autotest_files : LicPrg.t -> Lv6Id.idref option -> Lv6MainArgs.t -> uni ...@@ -87,9 +92,9 @@ let (gen_autotest_files : LicPrg.t -> Lv6Id.idref option -> Lv6MainArgs.t -> uni
let msk, zesoc = Lic2soc.f lic_prg nk in let msk, zesoc = Lic2soc.f lic_prg nk in
msk, zesoc, main_node msk, zesoc, main_node
) else ( ) else (
print_string ("Error: no node is specified, cannot exec.\n"); print_string ("Error: no node is specified, cannot exec.\nbye\n");
flush stdout; flush stdout;
exit 1 my_exit opt 1
) )
) )
| Some main_node -> | Some main_node ->
...@@ -242,8 +247,8 @@ let main () = ( ...@@ -242,8 +247,8 @@ let main () = (
Verbose.exe ~level:3 (fun () -> Verbose.exe ~level:3 (fun () ->
Gc.set { (Gc.get ()) with Gc.verbose = 0x01 } Gc.set { (Gc.get ()) with Gc.verbose = 0x01 }
); );
if opt.run_unit_test then (UnifyType.unit_test (); exit 0); if opt.run_unit_test then (UnifyType.unit_test (); my_exit opt 0);
if (opt.infiles = []) then (Lv6MainArgs.usage stderr opt; exit 1); if (opt.infiles = []) then (Lv6MainArgs.usage stderr opt; my_exit opt 1);
let new_dft_pack = Filename.basename (Filename.chop_extension (List.hd opt.infiles)) in let new_dft_pack = Filename.basename (Filename.chop_extension (List.hd opt.infiles)) in
Lv6Id.set_dft_pack_name new_dft_pack; Lv6Id.set_dft_pack_name new_dft_pack;
...@@ -257,7 +262,7 @@ let main () = ( ...@@ -257,7 +262,7 @@ let main () = (
if opt.print_interface then ( if opt.print_interface then (
gen_rif_interface lic_prg main_node opt; gen_rif_interface lic_prg main_node opt;
info "bye!"; info "bye!";
exit 0 my_exit opt 0
); );
if opt.Lv6MainArgs.gen_autotest then if opt.Lv6MainArgs.gen_autotest then
gen_autotest_files lic_prg main_node opt gen_autotest_files lic_prg main_node opt
...@@ -281,9 +286,9 @@ let main () = ( ...@@ -281,9 +286,9 @@ let main () = (
info "Start interpreting soc...\n"; info "Start interpreting soc...\n";
SocExec.f opt zesoc msk) SocExec.f opt zesoc msk)
) else ( ) else (
print_string ("Error: no node is specified, cannot exec.\n"); print_string ("Error: no node is specified, cannot exec.\nbye\n");
flush stdout; flush stdout;
exit 1 my_exit opt 1
) )
) )
| Some main_node -> | Some main_node ->
......
This diff is collapsed.
==> lus2lic0.sum <== ==> lus2lic0.sum <==
Test Run By jahier on Fri Jul 10 14:27:04 Test Run By jahier on Mon Aug 17 17:03:06
Native configuration is x86_64-unknown-linux-gnu Native configuration is x86_64-unknown-linux-gnu
=== lus2lic0 tests === === lus2lic0 tests ===
...@@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte ...@@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
==> lus2lic1.sum <== ==> lus2lic1.sum <==
Test Run By jahier on Fri Jul 10 14:27:08 Test Run By jahier on Mon Aug 17 17:03:07
Native configuration is x86_64-unknown-linux-gnu Native configuration is x86_64-unknown-linux-gnu
=== lus2lic1 tests === === lus2lic1 tests ===
...@@ -396,7 +396,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c ...@@ -396,7 +396,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
==> lus2lic2.sum <== ==> lus2lic2.sum <==
Test Run By jahier on Fri Jul 10 14:27:00 Test Run By jahier on Mon Aug 17 17:03:22
Native configuration is x86_64-unknown-linux-gnu Native configuration is x86_64-unknown-linux-gnu
=== lus2lic2 tests === === lus2lic2 tests ===
...@@ -735,7 +735,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c ...@@ -735,7 +735,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {} PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {}
==> lus2lic3.sum <== ==> lus2lic3.sum <==
Test Run By jahier on Fri Jul 10 14:27:06 Test Run By jahier on Mon Aug 17 17:04:10
Native configuration is x86_64-unknown-linux-gnu Native configuration is x86_64-unknown-linux-gnu
=== lus2lic3 tests === === lus2lic3 tests ===
...@@ -1237,7 +1237,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec} ...@@ -1237,7 +1237,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {} PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <== ==> lus2lic4.sum <==
Test Run By jahier on Fri Jul 10 14:27:02 Test Run By jahier on Mon Aug 17 17:04:24
Native configuration is x86_64-unknown-linux-gnu Native configuration is x86_64-unknown-linux-gnu
=== lus2lic4 tests === === lus2lic4 tests ===
...@@ -1751,13 +1751,13 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {} ...@@ -1751,13 +1751,13 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
=============================== ===============================
# Total number of failures: 23 # Total number of failures: 23
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 22 seconds lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 15 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 50 seconds lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 48 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 17 seconds lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 14 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 52 seconds lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 50 seconds
* Ref time: * Ref time:
0.04user 0.02system 2:03.11elapsed 0%CPU (0avgtext+0avgdata 5020maxresident)k 0.05user 0.02system 2:07.25elapsed 0%CPU (0avgtext+0avgdata 5068maxresident)k
0inputs+0outputs (0major+5526minor)pagefaults 0swaps 0inputs+0outputs (0major+5541minor)pagefaults 0swaps
* Quick time (-j 4): * Quick time (-j 4):
0.04user 0.01system 0:53.57elapsed 0%CPU (0avgtext+0avgdata 5028maxresident)k 0.04user 0.01system 0:58.09elapsed 0%CPU (0avgtext+0avgdata 5092maxresident)k
0inputs+0outputs (0major+5576minor)pagefaults 0swaps 64inputs+0outputs (0major+5543minor)pagefaults 0swaps
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