X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=blobdiff_plain;f=compiler%2Fsrc%2Fexe%2Ftigert.ml;h=c4d5bc87880aa81ba56c38d3e8255a4b74fe8492;hp=f5a58510a1ae5b51bea92bcc505f66f9e82d1512;hb=fca49f4f3908de86d5895b6a8708216fbb4dd529;hpb=8e47ed20c781e65940089e6f71e9a8ac6ea27d73 diff --git a/compiler/src/exe/tigert.ml b/compiler/src/exe/tigert.ml index f5a5851..c4d5bc8 100644 --- a/compiler/src/exe/tigert.ml +++ b/compiler/src/exe/tigert.ml @@ -1,5 +1,27 @@ +type suite = + | All of {dir : string} + | Book of {dir : string} + | Micro + let () = - let dir = ref "testcases" in - Arg.parse [("-dir", Arg.String (fun s -> dir := s), "")] (fun _ -> ()) ""; - let dir = !dir in - Tiger.Test.run (Tiger.Test_cases.all ~dir) + let suite = ref Micro in + let spec = ref [] in + Arg.parse_dynamic + spec + (function + | "micro" -> + spec := [] + | "book" -> + spec := [("-dir", Arg.String (fun dir -> suite := Book {dir}), "")] + | "all" -> + spec := [("-dir", Arg.String (fun dir -> suite := All {dir}), "")] + | _ -> () + ) + ""; + let suite = + match !suite with + | All {dir} -> Tiger.Test_cases.all ~dir + | Book {dir} -> Tiger.Test_cases.book ~dir + | Micro -> Tiger.Test_cases.micro + in + Tiger.Test.run suite