Skip to content

Commit

Permalink
Add a test_suite to j2cl_multi_test to make it easier to run all the …
Browse files Browse the repository at this point in the history
…tests.

PiperOrigin-RevId: 698588307
  • Loading branch information
gkdn authored and copybara-github committed Nov 21, 2024
1 parent 2c321a5 commit cc545e2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jre/javatests/j2cl_multi_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ load("@rules_java//java:defs.bzl", "java_test")
load("//build_defs:rules.bzl", "j2cl_test", "j2kt_native_test", "j2wasm_test")

def j2cl_multi_test(name, test_class, deps, enable_jvm = True, enable_j2kt_native = True, enable_wasm = True, **kwargs):
tests = [name + "-j2cl", name + "-j2cl_compiled"]

j2cl_deps = [dep + "-j2cl" for dep in deps]
j2cl_test(
name = name,
name = name + "-j2cl",
test_class = test_class,
generate_build_test = False,
runtime_deps = j2cl_deps,
**kwargs
)
j2cl_test(
name = name + "_compiled",
name = name + "-j2cl_compiled",
test_class = test_class,
compile = 1,
generate_build_test = False,
Expand All @@ -37,6 +39,7 @@ def j2cl_multi_test(name, test_class, deps, enable_jvm = True, enable_j2kt_nativ
)

if enable_jvm:
tests.append(name + "-jvm")
java_test(
name = name + "-jvm",
test_class = test_class,
Expand All @@ -45,6 +48,7 @@ def j2cl_multi_test(name, test_class, deps, enable_jvm = True, enable_j2kt_nativ
)

if enable_wasm:
tests += [name + "-j2wasm", name + "-j2wasm_optimized"]
j2wasm_deps = [dep + "-j2wasm" for dep in deps]
j2wasm_defines = {"jre.checks.checkLevel": "NORMAL"}
j2wasm_test(
Expand All @@ -66,3 +70,5 @@ def j2cl_multi_test(name, test_class, deps, enable_jvm = True, enable_j2kt_nativ
],
**kwargs
)

native.test_suite(name = name, tests = tests)

0 comments on commit cc545e2

Please sign in to comment.