Skip to content

Commit 3387bde

Browse files
committed
dunify in stdlib/regression
Signed-off-by: Kakadu <[email protected]>
1 parent e3f5e22 commit 3387bde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1059
-999
lines changed

stdlib/regression/Makefile

-14
This file was deleted.

stdlib/regression/dune

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
; This file was autogenerated
2+
3+
(cram (deps ../../src/Driver.exe))
4+
(cram (deps ../../runtime32/runtime.a ../../runtime32/Std.i))
5+
(cram (deps ../../runtime/runtime.a ../../runtime/Std.i))
6+
(cram (deps ../x32/Array.i ../x32/Array.o ../x32/Buffer.i ../x32/Buffer.o ../x32/Collection.i ../x32/Collection.o ../x32/Data.i ../x32/Data.o ../x32/Fun.i ../x32/Fun.o ../x32/Lazy.i ../x32/Lazy.o ../x32/List.i ../x32/List.o ../x32/Matcher.i ../x32/Matcher.o ../x32/Ostap.i ../x32/Ostap.o ../x32/Random.i ../x32/Random.o ../x32/Ref.i ../x32/Ref.o ../x32/STM.i ../x32/STM.o ../x32/Timer.i ../x32/Timer.o))
7+
(cram (deps ../x64/Array.i ../x64/Array.o ../x64/Buffer.i ../x64/Buffer.o ../x64/Collection.i ../x64/Collection.o ../x64/Data.i ../x64/Data.o ../x64/Fun.i ../x64/Fun.o ../x64/Lazy.i ../x64/Lazy.o ../x64/List.i ../x64/List.o ../x64/Matcher.i ../x64/Matcher.o ../x64/Ostap.i ../x64/Ostap.o ../x64/Random.i ../x64/Random.o ../x64/Ref.i ../x64/Ref.o ../x64/STM.i ../x64/STM.o ../x64/Timer.i ../x64/Timer.o))
8+
(cram (applies_to test01)
9+
(deps test01.lama))
10+
(cram (applies_to test02)
11+
(deps test02.lama))
12+
(cram (applies_to test03)
13+
(deps test03.lama))
14+
(cram (applies_to test04)
15+
(deps test04.lama))
16+
(cram (applies_to test05)
17+
(deps test05.lama))
18+
(cram (applies_to test06)
19+
(deps test06.lama))
20+
(cram (applies_to test07)
21+
(deps test07.lama))
22+
(cram (applies_to test08)
23+
(deps test08.lama))
24+
(cram (applies_to test09)
25+
(deps test09.lama))
26+
(cram (applies_to test10)
27+
(deps test10.lama))
28+
(cram (applies_to test11)
29+
(deps test11.lama))
30+
(cram (applies_to test12)
31+
(deps test12.lama))
32+
(cram (applies_to test13)
33+
(deps test13.lama))
34+
(cram (applies_to test14)
35+
(deps test14.lama))
36+
(cram (applies_to test15)
37+
(deps test15.lama))
38+
(cram (applies_to test16)
39+
(deps test16.lama))
40+
(cram (applies_to test17)
41+
(deps test17.lama))
42+
(cram (applies_to test18)
43+
(deps test18.lama))
44+
(cram (applies_to test20)
45+
(deps test20.lama))
46+
(cram (applies_to test21)
47+
(deps test21.lama))
48+
(cram (applies_to test22)
49+
(deps test22.lama))
50+
(cram (applies_to test23)
51+
(deps test23.lama))
52+
(cram (applies_to test24)
53+
(deps test24.lama))
54+
(cram (applies_to test25)
55+
(deps test25.lama))
56+
(cram (applies_to test26)
57+
(deps test26.lama))
58+
(cram (applies_to test27)
59+
(deps test27.lama))
60+
(cram (applies_to test28)
61+
(deps test28.lama))
62+
(cram (applies_to test29)
63+
(deps test29.lama))
64+
(cram (applies_to test32)
65+
(deps test32.lama))
66+
(cram (applies_to test33)
67+
(deps test33.lama))
68+
(cram (applies_to test34)
69+
(deps test34.lama))

stdlib/regression/gen.ml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
(* Run as `ocaml gen.ml` *)
2+
3+
let count = 35
4+
let stdlib = ["Array"; "Buffer"; "Collection"; "Data"; "Fun"; "Lazy"; "List"; "Matcher"; "Ostap"; "Random"; "Ref"; "STM"; "Timer" ]
5+
let sprintf = Printf.sprintf
6+
7+
let () =
8+
Out_channel.with_open_text "dune" (fun dunech ->
9+
let dprintfn fmt = Format.kasprintf (Printf.fprintf dunech "%s\n") fmt in
10+
dprintfn "; This file was autogenerated\n";
11+
dprintfn "(cram (deps ../../src/Driver.exe))";
12+
dprintfn "(cram (deps ../../runtime32/runtime.a ../../runtime32/Std.i))";
13+
dprintfn "(cram (deps ../../runtime/runtime.a ../../runtime/Std.i))";
14+
dprintfn "(cram (deps %s))"
15+
(String.concat " " (List.concat_map (fun s ->
16+
[sprintf "../x32/%s.i" s
17+
;sprintf "../x32/%s.o" s
18+
])
19+
stdlib));
20+
dprintfn "(cram (deps %s))"
21+
(String.concat " " (List.concat_map (fun s ->
22+
[sprintf "../x64/%s.i" s
23+
;sprintf "../x64/%s.o" s
24+
])
25+
stdlib));
26+
27+
for i = 0 to count - 1 do
28+
let cram_buf = Buffer.create 100 in
29+
let cram_printfn fmt =
30+
Format.kasprintf (Printf.bprintf cram_buf "%s\n") fmt
31+
in
32+
let cram_file = ref (Printf.sprintf "test%02d.t" i) in
33+
let lama_file = ref (Printf.sprintf "test%02d.lama" i) in
34+
35+
let found =
36+
if Sys.file_exists !lama_file && i <> 30 then (
37+
(* cram_printfn " $ ls ../x64"; *)
38+
cram_printfn
39+
" $ LAMA=../../runtime ../../src/Driver.exe -I ../x64 -ds -dp test%02d.lama -o test" i;
40+
cram_printfn " $ ./test";
41+
true)
42+
else false
43+
in
44+
if found then (
45+
dprintfn "(cram (applies_to test%02d)" i;
46+
dprintfn " (deps %s))" !lama_file;
47+
Out_channel.with_open_text !cram_file (fun ch ->
48+
output_string ch "This file was autogenerated.\n";
49+
output_string ch (Buffer.contents cram_buf)))
50+
done)

0 commit comments

Comments
 (0)