mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
More long tests in to separate directory
Signed-off-by: Kakadu <Kakadu@pm.me>
This commit is contained in:
parent
d849a2e6c7
commit
e471b35ed0
23062 changed files with 0 additions and 0 deletions
42
regression_long/deep-expressions/gen.ml
Normal file
42
regression_long/deep-expressions/gen.ml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
(* Run as `ocaml gen.ml` *)
|
||||
|
||||
let count = 1000
|
||||
let () =
|
||||
Out_channel.with_open_text "dune" (fun dunech ->
|
||||
let dprintfn fmt = Format.kasprintf (Printf.fprintf dunech "%s\n") fmt in
|
||||
dprintfn "; This file was autogenerated\n";
|
||||
dprintfn "(cram (deps ../../src/Driver.exe ../../runtime/Std.i))\n";
|
||||
for i=0 to count / 10 do
|
||||
let cram_buf = Buffer.create 100 in
|
||||
let cram_printfn fmt = Format.kasprintf (Printf.bprintf cram_buf "%s\n") fmt in
|
||||
cram_printfn "; This file was auto generated\n";
|
||||
let cram_file = Printf.sprintf "generated%04dx.t" i in
|
||||
let deps = ref [] in
|
||||
for j=0 to 9 do
|
||||
let k = (i*10+j) in
|
||||
let lama_file = Printf.sprintf "generated%05d.lama" k in
|
||||
let input_file = Printf.sprintf "generated%05d.input" k in
|
||||
|
||||
if Sys.file_exists lama_file then (
|
||||
deps := lama_file :: input_file :: !deps;
|
||||
cram_printfn " $ LAMA=../../runtime ../../src/Driver.exe -i generated%05d.lama < generated%05d.input" k k
|
||||
)
|
||||
done;
|
||||
match !deps with
|
||||
| [] -> ()
|
||||
| xs ->
|
||||
(dprintfn "(cram (applies_to generated%04dx)" i;
|
||||
dprintfn " (deps %s))" (String.concat " " (List.rev xs));
|
||||
Out_channel.with_open_text cram_file (fun ch ->
|
||||
output_string ch (Buffer.contents cram_buf))
|
||||
)
|
||||
done
|
||||
)
|
||||
(*
|
||||
let () =
|
||||
|
||||
for i=0 to count do
|
||||
if Sys.file_exists (Printf.sprintf "generated%05d.lama" i) then
|
||||
(Printf.fprintf ch "(cram (applies_to r%05d)\n" i;
|
||||
Printf.fprintf ch " (deps generated%05d.lama))\n%!" i;)
|
||||
done *)
|
||||
Loading…
Add table
Add a link
Reference in a new issue