X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=blobdiff_plain;f=compiler%2Fsrc%2Fexe%2Ftigert.ml;h=c4d5bc87880aa81ba56c38d3e8255a4b74fe8492;hp=bd7e12ddf3ebcd927a06306585a32ff8bddf7687;hb=fca49f4f3908de86d5895b6a8708216fbb4dd529;hpb=d3bdde4b6b0b1a8cb41ee4de4fa73cd472ed23a4 diff --git a/compiler/src/exe/tigert.ml b/compiler/src/exe/tigert.ml index bd7e12d..c4d5bc8 100644 --- a/compiler/src/exe/tigert.ml +++ b/compiler/src/exe/tigert.ml @@ -1,2 +1,27 @@ +type suite = + | All of {dir : string} + | Book of {dir : string} + | Micro + let () = - Tiger.Test.run Tiger.Test_cases.all + 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