From 62d8cc8dbf8adeb0d57d76de0b9230dd66ef381a Mon Sep 17 00:00:00 2001 From: Olivier Nicole Date: Sun, 29 Dec 2024 16:22:02 +0100 Subject: [PATCH] CR: move new tests to tests-jsoo/lib-effects --- .../lib-effects/assume_no_perform.ml | 0 .../assume_no_perform_nested_handler.ml | 0 .../assume_no_perform_unhandled.ml | 0 .../lib-effects/double-translation/dune | 40 +++++++++++++++++++ compiler/tests-jsoo/lib-effects/dune | 25 ++++++++++++ compiler/tests-ocaml/lib-effects/dune | 22 +--------- 6 files changed, 66 insertions(+), 21 deletions(-) rename compiler/{tests-ocaml => tests-jsoo}/lib-effects/assume_no_perform.ml (100%) rename compiler/{tests-ocaml => tests-jsoo}/lib-effects/assume_no_perform_nested_handler.ml (100%) rename compiler/{tests-ocaml => tests-jsoo}/lib-effects/assume_no_perform_unhandled.ml (100%) create mode 100644 compiler/tests-jsoo/lib-effects/double-translation/dune diff --git a/compiler/tests-ocaml/lib-effects/assume_no_perform.ml b/compiler/tests-jsoo/lib-effects/assume_no_perform.ml similarity index 100% rename from compiler/tests-ocaml/lib-effects/assume_no_perform.ml rename to compiler/tests-jsoo/lib-effects/assume_no_perform.ml diff --git a/compiler/tests-ocaml/lib-effects/assume_no_perform_nested_handler.ml b/compiler/tests-jsoo/lib-effects/assume_no_perform_nested_handler.ml similarity index 100% rename from compiler/tests-ocaml/lib-effects/assume_no_perform_nested_handler.ml rename to compiler/tests-jsoo/lib-effects/assume_no_perform_nested_handler.ml diff --git a/compiler/tests-ocaml/lib-effects/assume_no_perform_unhandled.ml b/compiler/tests-jsoo/lib-effects/assume_no_perform_unhandled.ml similarity index 100% rename from compiler/tests-ocaml/lib-effects/assume_no_perform_unhandled.ml rename to compiler/tests-jsoo/lib-effects/assume_no_perform_unhandled.ml diff --git a/compiler/tests-jsoo/lib-effects/double-translation/dune b/compiler/tests-jsoo/lib-effects/double-translation/dune new file mode 100644 index 0000000000..c3e273e341 --- /dev/null +++ b/compiler/tests-jsoo/lib-effects/double-translation/dune @@ -0,0 +1,40 @@ +(env + (with-effects + (flags + (:standard -w -38)) + (js_of_ocaml + (flags + (:standard --effects=double-translation)) + ;; separate compilation doesn't yet work when using + ;; '--effect=double-translation' since Dune doesn't know it should compile a + ;; different version of the dependencies. + ;; TODO: remove once support in ocaml/dune#11222 is released. + (compilation_mode whole_program))) + (_ + (flags + (:standard -w -38)) + (js_of_ocaml + (flags + (:standard --effects=double-translation)) + ;; separate compilation doesn't yet work when using + ;; '--effect=double-translation' since Dune doesn't know it should compile a + ;; different version of the dependencies. + ;; TODO: remove once support in ocaml/dune#11222 is released. + (compilation_mode whole_program)))) + +(copy_files# ../*.ml) + +(tests + (build_if + (>= %{ocaml_version} 5)) + (names + assume_no_perform + assume_no_perform_unhandled + assume_no_perform_nested_handler) + (libraries js_of_ocaml) + (action + (ignore-outputs + (with-accepted-exit-codes + 0 + (run node %{test})))) + (modes js)) diff --git a/compiler/tests-jsoo/lib-effects/dune b/compiler/tests-jsoo/lib-effects/dune index ef92e93dbb..b5b58f0f3e 100644 --- a/compiler/tests-jsoo/lib-effects/dune +++ b/compiler/tests-jsoo/lib-effects/dune @@ -10,5 +10,30 @@ (>= %{ocaml_version} 5)) (inline_tests (modes js wasm best)) + (modules + (:standard + \ + assume_no_perform + assume_no_perform_unhandled + assume_no_perform_nested_handler)) (preprocess (pps ppx_expect))) + +(tests + (build_if + (>= %{ocaml_version} 5)) + (names + assume_no_perform + assume_no_perform_unhandled + assume_no_perform_nested_handler) + (modules + assume_no_perform + assume_no_perform_unhandled + assume_no_perform_nested_handler) + (libraries js_of_ocaml) + (action + (ignore-outputs + (with-accepted-exit-codes + 0 + (run node %{test})))) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-effects/dune b/compiler/tests-ocaml/lib-effects/dune index 9ac073c2b3..ce1481b47d 100644 --- a/compiler/tests-ocaml/lib-effects/dune +++ b/compiler/tests-ocaml/lib-effects/dune @@ -34,12 +34,7 @@ test_lazy used_cont) (modules - (:standard - \ - unhandled_unlinked - assume_no_perform - assume_no_perform_unhandled - assume_no_perform_nested_handler)) + (:standard \ unhandled_unlinked)) (modes js wasm)) (tests @@ -54,18 +49,3 @@ (run node %{test})) (run cat))) (modes js wasm)) - -(tests - (build_if - (>= %{ocaml_version} 5)) - (names - assume_no_perform - assume_no_perform_unhandled - assume_no_perform_nested_handler) - (libraries js_of_ocaml) - (action - (ignore-outputs - (with-accepted-exit-codes - 0 - (run node %{test})))) - (modes js wasm))