Skip to content
Snippets Groups Projects
Commit cd960482 authored by erwan's avatar erwan
Browse files

Fix: the commit sha:712306a5 (3/5/19) break the code for ocaml < 4.06

Indeed the API of Format.formatter_out_functions changed in 4.06.0

To turn around this problem, I've used pp_get_formatter_out_functions
and extend it result
parent 1a1156b5
No related branches found
No related tags found
No related merge requests found
Pipeline #23954 passed
No preview for this file type
(* Time-stamp: <modified the 21/07/2017 (at 16:52) by Erwan Jahier> *)
(* Time-stamp: <modified the 17/05/2019 (at 10:39) by Erwan> *)
open Lxm
......@@ -681,17 +681,24 @@ let print_node_exp oc ne =
(* on one line for debug ... *)
let print_short_val_exp oc ve =
let os = Format.formatter_of_out_channel oc in
let fof : Format.formatter_out_functions =
{
let os = Format.formatter_of_out_channel oc in
let fof : Format.formatter_out_functions =
pp_get_formatter_out_functions os ()
in
let fof = {
fof
with
Format.out_string = (fun s p n -> output_string oc (String.sub s p n));
Format.out_newline = (fun () -> ());
Format.out_spaces = (fun _ -> ());
Format.out_indent = (fun _ -> ());
(* This one has been introduced in ocaml 4.06; hence we use
the default formater ti ovoid braking backward compatility
Format.out_indent = (fun _ -> ()); *)
Format.out_flush = (fun () -> flush oc);
} in
Format.pp_set_formatter_out_functions os fof;
dump_val_exp os ve;
pp_print_flush os ()
}
in
Format.pp_set_formatter_out_functions os fof;
dump_val_exp os ve;
pp_print_flush os ()
==> lus2lic0.sum <==
Test run by jahier on Wed May 15 18:03:06
Test run by jahier on Fri May 17 10:42:29
Native configuration is x86_64-pc-linux-gnu
=== lus2lic0 tests ===
......@@ -66,7 +66,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
==> lus2lic1.sum <==
Test run by jahier on Wed May 15 18:03:06
Test run by jahier on Fri May 17 10:42:30
Native configuration is x86_64-pc-linux-gnu
=== lus2lic1 tests ===
......@@ -409,7 +409,7 @@ PASS: sh multipar.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
==> lus2lic2.sum <==
Test run by jahier on Thu May 16 09:16:36
Test run by jahier on Fri May 17 10:42:52
Native configuration is x86_64-pc-linux-gnu
=== lus2lic2 tests ===
......@@ -749,7 +749,7 @@ PASS: sh zzz2.sh
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {}
==> lus2lic3.sum <==
Test run by jahier on Thu May 16 09:17:14
Test run by jahier on Fri May 17 10:43:19
Native configuration is x86_64-pc-linux-gnu
=== lus2lic3 tests ===
......@@ -1259,7 +1259,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test run by jahier on Thu May 16 09:17:54
Test run by jahier on Fri May 17 10:43:58
Native configuration is x86_64-pc-linux-gnu
=== lus2lic4 tests ===
......@@ -1777,13 +1777,13 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
===============================
# Total number of failures: 15
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 54810 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 38 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 40 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 18 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 22 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 27 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 39 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 15 seconds
* Ref time:
64.08user 21.45system 15:15:06elapsed 0%CPU (0avgtext+0avgdata 277032maxresident)k
0inputs+143192outputs (0major+10998297minor)pagefaults 0swaps
53.58user 18.93system 1:43.77elapsed 69%CPU (0avgtext+0avgdata 276760maxresident)k
32inputs+143296outputs (0major+11000415minor)pagefaults 0swaps
* Quick time (-j 4):
59.54user 19.53system 1:06.89elapsed 118%CPU (0avgtext+0avgdata 276536maxresident)k
0inputs+141296outputs (0major+10861295minor)pagefaults 0swaps
60.95user 19.78system 1:06.88elapsed 120%CPU (0avgtext+0avgdata 276748maxresident)k
2128inputs+141352outputs (0major+10869510minor)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