From bd79ffe3f0047c6b987cfbd1e78623fdcbe0c9fe Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 7 Feb 2025 22:30:19 +0100 Subject: [PATCH 1/4] docs: Add Mutation_test in index.mld --- src/index.mld | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.mld b/src/index.mld index ae8c940fa..5cb77b4fc 100644 --- a/src/index.mld +++ b/src/index.mld @@ -5,9 +5,10 @@ forming the engine for the learn-ocaml platform, and the common files. {1 List of documented modules} -Modules documentation could be found here: +The documentation of the main modules can be found here: {ul {li {{: Test_lib/index.html} [Test_lib]}} {li {{: Learnocaml_report/index.html} [Learnocaml_report]}} + {li {{: Mutation_test/index.html} [Mutation_test]}} } From 6467f4b3ea74164f2ef50ab27fc6a40062290a5b Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 7 Feb 2025 22:26:08 +0100 Subject: [PATCH 2/4] docs: Give public_name to libs for Learnocaml_report & Test_lib --- src/grader-plugins/mutation_test.mli | 2 +- src/grader/dune | 2 ++ src/grader/learnocaml_report.mli | 5 +++++ src/grader/test_lib.mli | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/grader-plugins/mutation_test.mli b/src/grader-plugins/mutation_test.mli index f87bde703..ad7544d50 100644 --- a/src/grader-plugins/mutation_test.mli +++ b/src/grader-plugins/mutation_test.mli @@ -6,7 +6,7 @@ * Learn-OCaml is distributed under the terms of the MIT license. See the * included LICENSE file for details. *) -(* This module provides functions for automatically grading +(** This module provides functions for automatically grading a student's unit tests using *mutation testing*. A student's tests for a function [foo] are run against several diff --git a/src/grader/dune b/src/grader/dune index baf4508d8..b1d93067a 100644 --- a/src/grader/dune +++ b/src/grader/dune @@ -1,5 +1,6 @@ (library (name learnocaml_report) + (public_name learn-ocaml.report) (wrapped false) (flags :standard -w -37-41 -warn-error -27-39) (modules Learnocaml_report) @@ -37,6 +38,7 @@ ;; dynamic (but pre-compiled) part (library (name testing_dyn) + (public_name learn-ocaml.test_lib) (wrapped false) (modes byte) (library_flags :standard -linkall) diff --git a/src/grader/learnocaml_report.mli b/src/grader/learnocaml_report.mli index e68ad8eeb..0206aaa96 100644 --- a/src/grader/learnocaml_report.mli +++ b/src/grader/learnocaml_report.mli @@ -6,6 +6,11 @@ * Learn-OCaml is distributed under the terms of the MIT license. See the * included LICENSE file for details. *) +(** Documentation for learn-ocaml's [report] library. + The [Learnocaml_report] module defines an AST for grading reports + generated by [Test_lib] functions. Supports both HTML output and + raw text output. *) + (** {2 Formatted report output} *) type t = item list diff --git a/src/grader/test_lib.mli b/src/grader/test_lib.mli index 3e25b90fc..5773e9841 100644 --- a/src/grader/test_lib.mli +++ b/src/grader/test_lib.mli @@ -6,8 +6,8 @@ * Learn-OCaml is distributed under the terms of the MIT license. See the * included LICENSE file for details. *) -(** Documentation for [test_lib] library. [Test_lib] module can be - used to write graders for learn-ocaml. *) +(** Documentation for learn-ocaml's [test_lib] library. + The [Test_lib] module can be used to write graders for learn-ocaml. *) val set_result : Learnocaml_report.t -> unit From 8d052be25c283a37336da142d75b7cc8171c1ff7 Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Fri, 7 Feb 2025 22:30:56 +0100 Subject: [PATCH 3/4] docs(dune): Recursively fix the error about a missing public_name Error: `Library "_" is private, it cannot be a dependency of a public library. You need to give "_" a public name. --- src/grader/dune | 3 +++ src/ppx-metaquot/dune | 6 ++++++ src/repo/dune | 1 + src/toplevel/dune | 1 + src/toploop/dune | 2 ++ 5 files changed, 13 insertions(+) diff --git a/src/grader/dune b/src/grader/dune index b1d93067a..f6ed40f01 100644 --- a/src/grader/dune +++ b/src/grader/dune @@ -19,6 +19,7 @@ ;; parts (Grading) and dynamic parts (Test_lib) (library (name introspection_intf) + (public_name learn-ocaml.introspection_intf) (wrapped false) (modules introspection_intf) (modules_without_implementation introspection_intf) @@ -27,6 +28,7 @@ ;; dynamic part, on which Test_lib depends (library (name pre_test) + (public_name learn-ocaml.pre_test) (wrapped false) (modules learnocaml_callback learnocaml_internal pre_test) (modules_without_implementation learnocaml_callback learnocaml_internal pre_test) @@ -183,6 +185,7 @@ (library (name grading) + (public_name learn-ocaml.grading) (wrapped false) (modes byte) (library_flags :standard -linkall) diff --git a/src/ppx-metaquot/dune b/src/ppx-metaquot/dune index eb958da56..cfcec35ff 100644 --- a/src/ppx-metaquot/dune +++ b/src/ppx-metaquot/dune @@ -1,5 +1,6 @@ (library (name ast_convenience) + (public_name learn-ocaml.ast_convenience) (modules Ast_convenience) (preprocess (action (run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file}))) (libraries compiler-libs.common) @@ -21,6 +22,7 @@ (library (name learnocaml_ppx_metaquot_lib) + (public_name learn-ocaml.ppx_metaquot_lib) (wrapped false) (flags :standard -w -17) (library_flags :standard -linkall) @@ -30,6 +32,7 @@ (library (name ppx_autoregister) + (public_name learn-ocaml.ppx_autoregister) (wrapped false) (libraries ppxlib) (modules Ppx_autoregister Printer_recorder)) @@ -44,6 +47,7 @@ (library (name grader_ppx) + (public_name learn-ocaml.grader_ppx) (wrapped false) (libraries learnocaml_ppx_metaquot_lib ty fun_ty ppx_autoregister) (modules Sampler_recorder Grader_ppx) @@ -69,6 +73,7 @@ (library (name ty) + (public_name learn-ocaml.ty) (wrapped false) (library_flags :standard -linkall) (modules Ty) @@ -77,6 +82,7 @@ (library (name fun_ty) + (public_name learn-ocaml.fun_ty) (wrapped false) (library_flags :standard -linkall) (modules Fun_ty) diff --git a/src/repo/dune b/src/repo/dune index 6d8606ec6..3e9343346 100644 --- a/src/repo/dune +++ b/src/repo/dune @@ -1,5 +1,6 @@ (library (name learnocaml_repository) + (public_name learn-ocaml.repository) (wrapped false) (modules Learnocaml_index Learnocaml_exercise) diff --git a/src/toplevel/dune b/src/toplevel/dune index 8b0e69d1d..b5bd78818 100644 --- a/src/toplevel/dune +++ b/src/toplevel/dune @@ -10,6 +10,7 @@ (library (name learnocaml_internal_intf) + (public_name learn-ocaml.internal_intf) (wrapped false) (modules learnocaml_internal_intf) (modules_without_implementation learnocaml_internal_intf) diff --git a/src/toploop/dune b/src/toploop/dune index 9f5eb9fea..99f1f97b9 100644 --- a/src/toploop/dune +++ b/src/toploop/dune @@ -1,5 +1,6 @@ (library (name toploop_results) + (public_name learn-ocaml.toploop_results) (wrapped false) (modules Toploop_results) (libraries compiler-libs.toplevel) @@ -7,6 +8,7 @@ (library (name toploop) + (public_name learn-ocaml.toploop) (wrapped false) (modes byte) (modules Toploop_ext) From 1ada3d44f145a8bb5bff3ad6f38652c0994dbb59 Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Sat, 8 Feb 2025 23:41:15 +0100 Subject: [PATCH 4/4] docs(dune): Recursively fix the error about a missing public_name, cont'ed (Error: `Library "_" is private, it cannot be a dependency of a public library. You need to give "_" a public name.) Now, the only remaining error raised by `make` is: ``` Error: Multiple rules generated for _build/install/default/lib/learn-ocaml/test_lib/test_lib.cmi: - src/grader/test_lib/dune:29 - src/grader/dune:41 -> required by _build/default/learn-ocaml.install -> required by alias install ppx src/grader-plugins/mutation_test.pp.mli ppx src/grader-plugins/mutation_test.pp.ml make: *** [Makefile:13: build] Error ``` --- src/grader/dune | 1 + src/toplevel/dune | 1 + src/utils/dune | 1 + 3 files changed, 3 insertions(+) diff --git a/src/grader/dune b/src/grader/dune index f6ed40f01..aff214e37 100644 --- a/src/grader/dune +++ b/src/grader/dune @@ -161,6 +161,7 @@ (library (name embedded_cmis) + (public_name learn-ocaml.embedded_cmis) (wrapped false) (modes byte) (modules Embedded_cmis) diff --git a/src/toplevel/dune b/src/toplevel/dune index b5bd78818..97facaec2 100644 --- a/src/toplevel/dune +++ b/src/toplevel/dune @@ -45,6 +45,7 @@ (library (name learnocaml_toplevel_pp) + (public_name learn-ocaml.toplevel_pp) (wrapped false) (modes byte) (libraries vg gg vg.svg) diff --git a/src/utils/dune b/src/utils/dune index 6d170487c..9686c22df 100644 --- a/src/utils/dune +++ b/src/utils/dune @@ -9,6 +9,7 @@ (library (name ocplib_i18n) + (public_name learn-ocaml.i18n) (wrapped false) (flags :standard -warn-error -4-42-44-45-48) (preprocess (pps ppx_ocplib_i18n))