Skip to content

Commit

Permalink
tidy up the public API a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
just-max committed Oct 13, 2023
1 parent 5485543 commit 96c5d75
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/test-lib/grading.ml
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,12 @@ let grade_files_to ?points_step_count ?cleanup ~grading_to grading paths =
let result = grade_files ?points_step_count ?cleanup grading paths in
write_result result grading_to
let grade_cleanup_files_to ?points_step_count ~grading_to ?grading =
match grading with
| None -> cleanup_files
| Some g -> grade_files_to ?points_step_count ~cleanup:true ~grading_to g
(* compat *)
let prettify_results ?grading path =
match grading with
| None -> cleanup_files [path]
| Some grading ->
grade_files_to grading [path] ~cleanup:true
~grading_to:Filename.(concat (basename path) "grading.xml")
grade_cleanup_files_to [path] ?grading
~grading_to:Filename.(concat (basename path) "grading.xml")
14 changes: 9 additions & 5 deletions src/test-lib/grading.mli
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,13 @@ val grade_files_to :
(** Combines {!grade_files} and {!write_result},
writing the result to [grading_to]. *)

val[@deprecated "use cleanup_files or grade_files_to"] prettify_results :
val grade_cleanup_files_to :
?points_step_count:int ->
?cleanup:bool -> grading_to:string -> ?grading:grading -> string list -> unit
(** If [grading] is [None], as per {!cleanup_files} with [~cleanup:true].
Otherwise, as per {!grade_files_to}, with [~cleanup:true]. *)

val[@deprecated "use grade_cleanup_files_to"] prettify_results :
?grading:grading -> string -> unit
(** If [grading] is [None], as per {!cleanup_file} with the output
written back to the same file. Otherwise, as per [grade_files_to],
with [~cleanup:true] and with grading written to [grading.xml] in
the same directory. *)
(** As per {!grade_cleanup_files_to} with a single path and with grading
written to [grading.xml] in the same directory. *)

0 comments on commit 96c5d75

Please sign in to comment.