Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inline_tests with jsoo and whole_program compilation mode #6645

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 6 additions & 0 deletions test/blackbox-tests/test-cases/jsoo/inline-tests.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ Run inline tests using node js
inline tests (JS)
inline tests (Native)
inline tests (Native)

$ dune runtest --profile release
inline tests (JS)
inline tests (JS)
inline tests (Native)
inline tests (Native)