File tree 12 files changed +65
-42
lines changed
demo-repository/exercises/demo 12 files changed +65
-42
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ package "test_lib" (
4
4
description = "Learn-ocaml dependencies for automatic graders"
5
5
requires = "compiler-libs"
6
6
)
7
+ # DUNE_GEN
Original file line number Diff line number Diff line change
1
+ learn-ocaml.mutation_testing
Original file line number Diff line number Diff line change
1
+ (library
2
+ (name mutation_testing)
3
+ (public_name learn-ocaml.mutation_testing)
4
+ (wrapped false)
5
+ (modes byte)
6
+ (libraries compiler-libs)
7
+ ;; The following lines are specific for compiling from within learn-ocaml.
8
+ ;; When writing grader-helper libs, use instead:
9
+ ;; (libraries learn-ocaml.test_lib)
10
+ ;; (preprocess (action (run %{libexec:learn-ocaml.test_lib:grader-ppx} %{input-file})))
11
+ (flags (:standard -I src/grader/test_lib -open Test_lib.Open_me))
12
+ (modules mutation_test)
13
+ (preprocess (pps grader_ppx))
14
+ (preprocessor_deps (alias ../grader/test_lib/test_lib_cmis))
15
+ ;; this is not a preprocessor deps, but dune does not allow other kinds of deps...
16
+ )
File renamed without changes.
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ module M: sig
100
100
val passed_mutation_testing : Learnocaml_report .t -> bool
101
101
end
102
102
103
- include M
103
+ include module type of M
104
104
105
105
(* * For backwards compatibility *)
106
- module Make (_: module type of Test_lib ) = M
106
+ module Make (_: module type of Test_lib ): module type of M
Original file line number Diff line number Diff line change 35
35
(library_flags :standard -linkall)
36
36
(libraries ty
37
37
toploop
38
- learnocaml_ppx_metaquot
39
38
learnocaml_ppx_metaquot_lib
39
+ grader_ppx
40
40
ocplib-json-typed
41
41
learnocaml_report
42
42
learnocaml_repository
43
43
introspection_intf
44
44
pre_test)
45
45
(modules Test_lib)
46
- (preprocess (pps learnocaml_ppx_metaquot ))
46
+ (preprocess (pps grader_ppx ))
47
47
)
48
48
(rule
49
49
(target testing_dyn.js)
167
167
(run ocp-ocamlres -format ocamlres %{deps})))
168
168
)
169
169
170
- ;; cmis that are needed to precompile the graders for exercises
171
- (install
172
- (section lib)
173
- (package learn-ocaml)
174
- (files
175
- (../ppx-metaquot/.ty.objs/byte/ty.cmi as test_lib/ty.cmi)
176
- (../ppx-metaquot/.fun_ty.objs/byte/fun_ty.cmi as test_lib/fun_ty.cmi)
177
- ;; (.exercise_init.objs/byte/exercise_init.cmi as test_lib/exercise_init.cmi)
178
- (.introspection_intf.objs/byte/introspection_intf.cmi as test_lib/introspection_intf.cmi)
179
- (.pre_test.objs/byte/learnocaml_internal.cmi as test_lib/learnocaml_internal.cmi)
180
- (.pre_test.objs/byte/pre_test.cmi as test_lib/pre_test.cmi)
181
- (.learnocaml_report.objs/byte/learnocaml_report.cmi as test_lib/learnocaml_report.cmi)
182
- (.pre_test.objs/byte/learnocaml_callback.cmi as test_lib/learnocaml_callback.cmi) ;;FIXME separate lib??
183
- (.testing_dyn.objs/byte/test_lib.cmi as test_lib/test_lib.cmi))
184
- )
185
-
186
-
187
170
(library
188
171
(name grading)
189
172
(wrapped false)
190
173
(modes byte)
191
174
(library_flags :standard -linkall)
192
- (libraries learnocaml_ppx_metaquot
175
+ (libraries grader_ppx
193
176
ocplib-ocamlres.runtime
194
177
toploop
195
178
learnocaml_internal_intf
201
184
(modules Introspection
202
185
Embedded_grading_lib
203
186
Grading)
204
- (preprocess (per_module ((pps ppx_ocplib_i18n learnocaml_ppx_metaquot ) Grading)))
187
+ (preprocess (per_module ((pps ppx_ocplib_i18n grader_ppx ) Grading)))
205
188
)
206
189
207
190
Original file line number Diff line number Diff line change
1
+ ;; cmis that are needed to precompile the graders for exercises
2
+
3
+ (rule
4
+ (alias test_lib_cmis)
5
+ (action (progn
6
+ (copy %{dep:../../ppx-metaquot/.ty.objs/byte/ty.cmi} ty.cmi)
7
+ (copy %{dep:../../ppx-metaquot/.fun_ty.objs/byte/fun_ty.cmi} fun_ty.cmi)
8
+ ;; (copy %{dep:../.exercise_init.objs/byte/exercise_init.cmi} exercise_init.cmi)
9
+ (copy %{dep:../.introspection_intf.objs/byte/introspection_intf.cmi} introspection_intf.cmi)
10
+ (copy %{dep:../.pre_test.objs/byte/learnocaml_internal.cmi} learnocaml_internal.cmi)
11
+ (copy %{dep:../.pre_test.objs/byte/pre_test.cmi} pre_test.cmi)
12
+ (copy %{dep:../.learnocaml_report.objs/byte/learnocaml_report.cmi} learnocaml_report.cmi)
13
+ (copy %{dep:../.pre_test.objs/byte/learnocaml_callback.cmi} learnocaml_callback.cmi)
14
+ (copy %{dep:../.testing_dyn.objs/byte/test_lib.cmi} test_lib.cmi)))
15
+ )
16
+
17
+ (install
18
+ (section lib)
19
+ (package learn-ocaml)
20
+ (files
21
+ (ty.cmi as test_lib/ty.cmi)
22
+ (fun_ty.cmi as test_lib/fun_ty.cmi)
23
+ ;; (exercise_init.cmi as test_lib/exercise_init.cmi)
24
+ (introspection_intf.cmi as test_lib/introspection_intf.cmi)
25
+ (learnocaml_internal.cmi as test_lib/learnocaml_internal.cmi)
26
+ (pre_test.cmi as test_lib/pre_test.cmi)
27
+ (learnocaml_report.cmi as test_lib/learnocaml_report.cmi)
28
+ (learnocaml_callback.cmi as test_lib/learnocaml_callback.cmi)
29
+ (test_lib.cmi as test_lib/test_lib.cmi))
30
+ )
Original file line number Diff line number Diff line change 20
20
(libraries ppx_tools compiler-libs)
21
21
)
22
22
23
- ;; (library
24
- ;; (name learnocaml_recorder)
25
- ;; (wrapped false)
26
- ;; (modules Recorder)
27
- ;; (libraries ppxlib))
28
-
29
23
(library
30
- (name learnocaml_ppx_metaquot )
24
+ (name grader_ppx )
31
25
(wrapped false)
32
26
(libraries learnocaml_ppx_metaquot_lib ty fun_ty ocaml-migrate-parsetree ppxlib)
33
- (modules Ppx_autoregister Ppx_metaquot_grader )
27
+ (modules Ppx_autoregister Grader_ppx )
34
28
(kind ppx_rewriter)
35
29
)
36
30
37
31
(executable
38
- (name ppx_metaquot_main )
39
- (modules ppx_metaquot_main )
40
- (libraries learnocaml_ppx_metaquot ))
32
+ (name grader_ppx_main )
33
+ (modules grader_ppx_main )
34
+ (libraries grader_ppx ))
41
35
42
36
(install
43
37
(section libexec)
44
38
(package learn-ocaml)
45
- (files
46
- (ppx_metaquot_main.exe as grading_ppx/learnocaml-ppx-grader))
39
+ (files (grader_ppx_main.exe as test_lib/grader-ppx))
47
40
)
48
41
49
42
(library
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ let () =
2
+ Migrate_parsetree.Driver. run_main ~exit_on_error: true ()
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
open Lwt.Infix
4
4
5
5
(* FIXME: make these configurable *)
6
- let grading_cmis_dir, grading_ppx_dir =
6
+ let grading_cmis_dir =
7
7
let prefix = Filename. dirname (Filename. dirname (Sys. executable_name)) in
8
8
let ( / ) = Filename. concat in
9
- ref (prefix/ " lib" / " learn-ocaml" / " test_lib" ),
10
- ref (prefix/ " lib" / " learn-ocaml" / " grading_ppx" )
9
+ ref (prefix/ " lib" / " learn-ocaml" / " test_lib" )
11
10
12
11
let run ?dir cmd args =
13
12
Lwt_process. exec ?cwd:dir (" " , Array. of_list (cmd::args)) >> = function
@@ -85,7 +84,7 @@ let precompile ~exercise_dir =
85
84
jsoo ~dir [] ~source: " exercise.cma" ~target: " exercise.js" );
86
85
(ocamlc ~dir ([" -c" ;
87
86
" -I" ; " +compiler-libs" ;
88
- " -ppx" ; Filename. concat ! grading_ppx_dir " learnocaml -ppx-grader " ]
87
+ " -ppx" ; Filename. concat ! grading_cmis_dir " grader -ppx --as-ppx " ]
89
88
@ grader_flags)
90
89
~opn: [" Learnocaml_callback" ; " Prelude" ; " Prepare" ; " Test_lib.Open_me" ]
91
90
~source: [" test.ml" ]
You can’t perform that action at this time.
0 commit comments