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

Run all tests with double translation too #1821

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ jobs:
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

# Pin Dune to a version which supports the new --effects flag
# (https://github.com/ocaml/dune/pull/11222).
- name: Pin Dune
run: opam pin add --no-action dune https://github.com/OlivierNicole/dune.git#jsoo-effects

# Work-around a race between reinstalling mingw-w64-shims
# (because of conf-pkg-config optional dep) and installing other
# packages that implicitly depend on mingw-w64-shims.
Expand Down Expand Up @@ -151,6 +156,9 @@ jobs:
- run: opam exec -- dune build @all @runtest @runtest-js --profile with-effects
if: ${{ !matrix.skip-effects }}

- run: opam exec -- dune build @all @runtest @runtest-js --profile with-effects-double-translation
if: ${{ !matrix.skip-effects }}

- run: opam exec -- git diff --exit-code
if: ${{ !matrix.skip-test }}

Expand Down
2 changes: 1 addition & 1 deletion compiler/tests-dynlink-js/effects_flags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let () =
let major = String.split_on_char '.' Sys.ocaml_version |> List.hd |> int_of_string in
let has_effect l =
match l with
| [ "with-effects" ] -> major >= 5
| [ ("with-effects" | "with-effects-double-translation") ] -> major >= 5
| _ -> false
in
let aux l = enable (has_effect l) "effects" in
Expand Down
63 changes: 0 additions & 63 deletions compiler/tests-jsoo/lib-effects-2/dune

This file was deleted.

70 changes: 0 additions & 70 deletions compiler/tests-ocaml/effects-2/dune

This file was deleted.

16 changes: 16 additions & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@
(binaries
(tools/node_wrapper.exe as node)
(tools/node_wrapper.exe as node.exe)))
(with-effects-double-translation
(js_of_ocaml
(compilation_mode separate)
(flags
(:standard --enable effects --effects double-translation))
(build_runtime_flags
(:standard --enable effects --effects double-translation)))
(wasm_of_ocaml
(compilation_mode separate)
(flags
(:standard --enable effects))
(build_runtime_flags
(:standard --enable effects)))
(binaries
(tools/node_wrapper.exe as node)
(tools/node_wrapper.exe as node.exe)))
(bench_no_debug
(flags
(:standard \ -g))
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/test_fun_call.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let s x =
if(x === undefined)
return "undefined"
if(typeof x === "function")
return "function#" + x.length + "#" + x.l
return "function#" + (x.l > 0 ? x.l : x.length) + "#" + x.l
if(x.toString() == "[object Arguments]")
return "(Arguments: " + Array.prototype.slice.call(x).toString() + ")";
return x.toString()
Expand Down
4 changes: 3 additions & 1 deletion tools/node_wrapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ let extra_args_for_wasoo =
; "--stack-size=10000"
]

let extra_args_for_jsoo = [ "--stack-size=3000" ]

let env = Unix.environment ()

let env =
Expand All @@ -28,7 +30,7 @@ let args =
match argv with
| file :: _ when Filename.check_suffix file ".wasm.js" ->
extra_args_for_wasoo @ argv
| _ -> argv
| _ -> extra_args_for_jsoo @ argv
in
Array.of_list (exe :: argv)
| [] -> assert false
Expand Down
Loading