-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate dune diff rules in examples/
- Generating the diff rules using a helper program should make it easier to add new examples.
- Loading branch information
Showing
4 changed files
with
115 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
; dune file generated by './gen-dune/main.exe' -- do not edit. | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff calculator.ml.expected calculator.ml))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff calculator.mli.expected calculator.mli))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example01.ml.expected example01.ml))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example01.mli.expected example01.mli))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example03.ml.expected example03.ml))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example03.mli.expected example03.mli))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example04.ml.expected example04.ml))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example04.mli.expected example04.mli))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example05.ml.expected example05.ml))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff example05.mli.expected example05.mli))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff file_server.ml.expected file_server.ml))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff file_server.mli.expected file_server.mli))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff orgchart.ml.expected orgchart.ml))) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(diff orgchart.mli.expected orgchart.mli))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(executable | ||
(name main)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(* This is a helper program used to generate dune rules that get included to the | ||
parent directory's dune file, via [../dune.inc]. *) | ||
|
||
let () = | ||
Printf.printf | ||
"; dune file generated by './gen-dune/main.exe' -- do not edit.\n"; | ||
Sys.argv |> Array.to_list |> List.tl |> List.sort String.compare | ||
|> List.iter (fun arg -> | ||
List.iter | ||
(fun ext -> | ||
let file = arg ^ ext in | ||
Printf.printf | ||
{| | ||
(rule | ||
(alias runtest) | ||
(action | ||
(diff %s.expected %s))) | ||
|} | ||
file file) | ||
[ ".ml"; ".mli" ]) |