Skip to content

Commit

Permalink
fix: inline tests, jsoo, whole program compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com>
  • Loading branch information
hhugo authored and rgrinberg committed Dec 6, 2022
1 parent c2909fd commit 183dfa6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Unreleased
`copy#` and `copy_files#`. The old heuristic of looking for a module in
parent directories is removed (#6594, @rgrinberg)

- Fix inline tests with js_of_ocaml and whole program compilation mode enabled
(#6645, @hhugo)

3.6.0 (2022-11-14)
------------------

Expand Down
14 changes: 9 additions & 5 deletions src/dune_rules/inline_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,17 @@ include Sub_system.Register_end_point (struct
Mode_conf.Set.add info.modes Byte
else info.modes
in
List.map (Mode_conf.Set.to_list modes) ~f:(fun (mode : Mode_conf.t) ->
List.concat_map (Mode_conf.Set.to_list modes)
~f:(fun (mode : Mode_conf.t) ->
match mode with
| Native -> Exe.Linkage.native
| Best -> Exe.Linkage.native_or_custom (Super_context.context sctx)
| Native -> [ Exe.Linkage.native ]
| Best ->
[ Exe.Linkage.native_or_custom (Super_context.context sctx) ]
| Byte ->
Exe.Linkage.custom_with_ext ~ext:".bc" (Super_context.context sctx)
| Javascript -> Exe.Linkage.js)
[ Exe.Linkage.custom_with_ext ~ext:".bc"
(Super_context.context sctx)
]
| Javascript -> [ Exe.Linkage.js; Exe.Linkage.byte_for_jsoo ])
in
let* (_ : Exe.dep_graphs) =
let link_args =
Expand Down
10 changes: 2 additions & 8 deletions test/blackbox-tests/test-cases/jsoo/inline-tests.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ Run inline tests using node js
inline tests (Native)

$ dune runtest --profile release
inline tests (JS)
inline tests (JS)
inline tests (Native)
inline tests (Native)
File "js/dune", line 1, characters 0-123:
1 | (library
2 | (name inline_tests_js)
3 | (js_of_ocaml (javascript_files js.js))
4 | (inline_tests (modes js) (backend fake_backend)))
Error: No rule found for
js/.inline_tests_js.inline-tests/inline_test_runner_inline_tests_js.bc-for-jsoo
[1]

0 comments on commit 183dfa6

Please sign in to comment.