diff --git a/sexpr.ml b/sexpr.ml index a0ba3da..f439f42 100644 --- a/sexpr.ml +++ b/sexpr.ml @@ -1,15 +1,19 @@ -module Testing = struct - type result = Pass | Fail | Skip +module type Testing = sig + val test : string -> ?depends:(string list) -> (unit -> unit) -> unit;; +end;; - let testing = ref false - let test_only = ref [] - let test_results = ref [] +module Testing : Testing = struct + type result = Pass | Fail | Skip;; + + let testing = ref false;; + let test_only = ref [];; + let test_results = ref [];; let rec should_skip test = match List.assoc_opt test !test_results with Some Fail | Some Skip -> true - | _ -> false + | _ -> false;; let test name ?(depends = []) run = let test_only = !test_only in @@ -33,7 +37,7 @@ module Testing = struct Fail end; in test_results := (name, res) :: !test_results - end + end;; let () = let rec proc args = @@ -49,9 +53,9 @@ module Testing = struct | hd :: tl -> proc tl end - in proc @@ Array.to_list Sys.argv -end -let test = Testing.test + in proc @@ Array.to_list Sys.argv;; +end;; +let test = Testing.test;; module PC = struct