diff --git a/src/dune_rules/inline_tests.ml b/src/dune_rules/inline_tests.ml index a6fe30ffad4..cb56097c2c7 100644 --- a/src/dune_rules/inline_tests.ml +++ b/src/dune_rules/inline_tests.ml @@ -296,7 +296,15 @@ include Sub_system.Register_end_point (struct | Error _ -> Action_builder.return action | Ok p -> Action_builder.path p >>> Action_builder.return action) and+ () = deps - and+ () = Action_builder.path exe in + and+ () = Action_builder.path exe + and+ () = + match mode with + | Native | Best | Byte | Jsoo JS -> Action_builder.return () + | Jsoo Wasm -> + Action_builder.path + (Path.build + (Path.Build.relative inline_test_dir (name ^ Js_of_ocaml.Ext.wasm_dir))) + in Action.chdir (Path.build dir) action in let flags partition : string list Action_builder.t = diff --git a/src/dune_rules/test_rules.ml b/src/dune_rules/test_rules.ml index d1a5e1ceac9..d91a7d7e765 100644 --- a/src/dune_rules/test_rules.ml +++ b/src/dune_rules/test_rules.ml @@ -104,7 +104,14 @@ let rules (t : Tests.t) ~sctx ~dir ~scope ~expander ~dir_contents = | None -> t.deps | Some _ -> Bindings.Unnamed (Dep_conf.File (String_with_vars.make_text loc test_exe)) - :: t.deps + :: + (match runtest_mode with + | `js Wasm -> + Bindings.Unnamed + (Dep_conf.File + (String_with_vars.make_text loc (s ^ Js_of_ocaml.Ext.wasm_dir))) + :: t.deps + | `js JS | `exe | `bc -> t.deps) in let add_alias ~loc ~action = (* CR rgrinberg: why are we going through the stanza api? *) diff --git a/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/dune-project b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/dune-project new file mode 100644 index 00000000000..3e2a6150dda --- /dev/null +++ b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/dune-project @@ -0,0 +1 @@ +(lang dune 3.17) diff --git a/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/inline_test/dune b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/inline_test/dune new file mode 100644 index 00000000000..9f3c7cc0119 --- /dev/null +++ b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/inline_test/dune @@ -0,0 +1,11 @@ +(library + (name inline_test) + (modules inline_test) + (inline_tests + (modes wasm) + (backend inline_test_backend))) + +(library + (name inline_test_backend) + (modules inline_test_backend) + (inline_tests.backend (generate_runner (echo "")))) diff --git a/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/inline_test/inline_test.ml b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/inline_test/inline_test.ml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/inline_test/inline_test_backend.ml b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/inline_test/inline_test_backend.ml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/run.t b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/run.t new file mode 100644 index 00000000000..3b99562c493 --- /dev/null +++ b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/run.t @@ -0,0 +1,3 @@ +Run tests and inline tests within a sandbox in copy mode + + $ dune runtest --sandbox=copy diff --git a/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/test/dune b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/test/dune new file mode 100644 index 00000000000..a09499c6339 --- /dev/null +++ b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/test/dune @@ -0,0 +1,3 @@ +(test + (modes wasm) + (name test)) diff --git a/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/test/test.ml b/test/blackbox-tests/test-cases/wasmoo/sandboxing.t/test/test.ml new file mode 100644 index 00000000000..e69de29bb2d