(env
 (with-effects-double-translation)
 (with-native-effects)
 (with-effects)
 (wasi-with-native-effects)
 (wasi
  (wasm_of_ocaml
   (flags
    (:standard --effects cps))))
 (_
  (js_of_ocaml
   (flags
    (:standard --effects cps)))))

(tests
 (build_if
  (>= %{ocaml_version} 5))
 (names
  cmphash
  marshal
  evenodd
  manylive
  overflow
  partial
  reperform
  sched
  shallow_state_io
  shallow_state
  test10
  test11
  test1
  test2
  test3
  test4
  test5
  test6
  test_lazy
  used_cont)
 (modules
  (:standard \ unhandled_unlinked))
 (modes js wasm))

; This test asserts Node's exit-2-on-uncaught-exception convention,
; which is wired through `process.on("uncaughtException", ...)`. QuickJS
; has no equivalent global error event, so the exit code differs.

(tests
 (build_if
  (>= %{ocaml_version} 5))
 (enabled_if
  (<> %{profile} quickjs))
 (names unhandled_unlinked)
 (modules unhandled_unlinked)
 (action
  (pipe-outputs
   (with-accepted-exit-codes
    2
    (run node %{test}))
   (run cat)))
 (modes js wasm))
