This commit is contained in:
2025-08-31 00:16:33 +02:00
parent f87e5c36f4
commit d01e77e0d2

View File

@@ -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