Use our own annotation for triggering our APT.
@@ -54,16 +54,14 @@ _TEMPLATE = """// THIS IS GENERATED CODE. DO NOT EDIT.
package %s;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
+import com.google.j2cl.junit.J2ClSuiteClasses;
/**
* J2cl java tests.
*
* @author Class generated by build rule j2cl_java_test.
*/
-@RunWith(Suite.class)
-@Suite.SuiteClasses({%s})
+@J2ClSuiteClasses({%s})
public class %s {
}
"""
@@ -125,6 +123,10 @@ def j2cl_java_test(**kwargs):
# it in transpilation
kwargs["srcs"] = kwargs[
"srcs"] + [base_name.title() + "_generated_suite.java"]
+ if not "deps" in kwargs:
+ kwargs["deps"] = []
+ kwargs["deps"] = kwargs[
+ "deps"] + ["//junit/java/com/google/j2cl/junit:junit_annotations"]
kwargs["testonly"] = 1
