diff --git a/CHANGES.md b/CHANGES.md index 07018809ef4..3743c618276 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) ------------------ diff --git a/src/dune_rules/inline_tests.ml b/src/dune_rules/inline_tests.ml index 54fd88861e9..868feb3a119 100644 --- a/src/dune_rules/inline_tests.ml +++ b/src/dune_rules/inline_tests.ml @@ -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 = diff --git a/test/blackbox-tests/test-cases/jsoo/inline-tests.t/run.t b/test/blackbox-tests/test-cases/jsoo/inline-tests.t/run.t index 1b2d70bab0b..fff4e506fa5 100644 --- a/test/blackbox-tests/test-cases/jsoo/inline-tests.t/run.t +++ b/test/blackbox-tests/test-cases/jsoo/inline-tests.t/run.t @@ -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)