Allow dash in name of junit_tests rule
So far, if the name of the rule contained a dash (hyphen), as in
high-availability plugin for example, the test execution failed with
error message:
bazel-out/local-fastbuild/bin/high-availability_testsTestSuite.java:6:
error: '{' expected
public class high-availability_testsTestSuite {}
^
This is due to the fact that dashes are not valid characters in the name
of a Java class.
Workaround this by replacing any dash with an underscore.
Change-Id: I80fd4c5bcff0d2af6f337636bd942f30d6a521c6
diff --git a/tools/junit.bzl b/tools/junit.bzl
index 19974a7..c820d10 100644
--- a/tools/junit.bzl
+++ b/tools/junit.bzl
@@ -63,7 +63,7 @@
)
def junit_tests(name, srcs, **kwargs):
- s_name = name + "TestSuite"
+ s_name = name.replace("-", "_") + "TestSuite"
_GenSuite(name = s_name,
srcs = srcs,
outname = s_name)