google / j2cl

Java to Closure JavaScript transpiler
Apache License 2.0
1.22k stars 143 forks source link

JUnit test example for wasm #197

Closed treblereel closed 5 months ago

treblereel commented 1 year ago

There is a test example for java to javascript example. Could you add a JUnit test example for wasm?

PS: To be honest, I am not sure if such a case is implemented.

gkdn commented 1 year ago

It works the same way as JavaScript however we cannot add it to CI since it doesn't have binaryen integration (currently assumes binaryen is in the path).

@mollyibot Could you manually test this to check if we are missing anything?

mollyibot commented 1 year ago

I first changed j2wasm_generate_jsunit_suite to take Label("//build_defs/internal_do_not_use:internal_junit_runtime-j2wasm") instead of "//build_defs/internal_do_not_use:internal_junit_runtime-j2wasm", then bazel build //src/test/java/com/google/j2cl/samples/helloworldlib:HelloWorldTest_generated_suite_j2wasm_application but it gives me an error Binaryen (wasm-opt) is not available. Aborting., Any thoughts?

gkdn commented 1 year ago

We expect binaryen to be available on the path. See here: https://github.com/google/j2cl/blob/dcf29c75c6e79713987e620eb220cf540e8eb708/third_party/binaryen.sh

treblereel commented 1 year ago

@gkdn cool, thanks a million!

gkdn commented 5 months ago

This was done so closing it.