aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/test/BUILD
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-03-10 12:32:21 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-03-10 16:13:29 +0100
commitc513e114a0a5f97891433b80bf442c5e9acaf22b (patch)
treed3c1bb107bd3e7900f328235d0451bf87af990a7 /third_party/ijar/test/BUILD
parenta5a11203aa75729bd0b3a29a22a63977ee2267a0 (diff)
Open-source ijar's tests
-- MOS_MIGRATED_REVID=88210083
Diffstat (limited to 'third_party/ijar/test/BUILD')
-rw-r--r--third_party/ijar/test/BUILD105
1 files changed, 105 insertions, 0 deletions
diff --git a/third_party/ijar/test/BUILD b/third_party/ijar/test/BUILD
new file mode 100644
index 0000000000..cb17830fc8
--- /dev/null
+++ b/third_party/ijar/test/BUILD
@@ -0,0 +1,105 @@
+package(default_visibility = ["//visibility:__pkg__"])
+
+licenses(["notice"]) # Apache License 2.0
+
+exports_files(["LICENSE"])
+
+sh_test(
+ name = "ijar_test",
+ size = "large",
+ srcs = ["ijar_test.sh"],
+ args = [
+ "$(JAVAC)",
+ "$(JAVA)",
+ "$(JAVABASE)/bin/jar",
+ "$(JAVABASE)/bin/javap",
+ "$(location //third_party/ijar)",
+ "$(location //tools/jdk:langtools)",
+ # We assume unzip and zip to be on the path
+ "unzip",
+ "zip",
+ ],
+ data = [
+ "//third_party/ijar",
+ "A.java",
+ "B.java",
+ "Object.java",
+ "WellCompressed1.java",
+ "WellCompressed2.java",
+ ":libtypeannotations2.jar",
+ "TypeAnnotationTest2.java",
+ # invokedynamic/ClassWithLambda.java, compiled with javac8
+ ":libinvokedynamic.jar",
+ # Intentionally bad test JAR: file count in central directory
+ # wrong.
+ "libwrongcentraldir.jar",
+ "//tools/defaults:jdk",
+ "//tools/jdk:langtools",
+ ],
+)
+
+java_library(
+ name = "invokedynamic",
+ testonly = 1,
+ srcs = ["invokedynamic/ClassWithLambda.java"],
+ javacopts = ["-source 8 -target 8"],
+)
+
+# For testing purposes: a class which exposes a private nested class in
+# public API, classes with annotations and a class with different forms of
+# deprecations markers
+java_library(
+ name = "ijar_testlib",
+ srcs = [
+ "AnnotatedClass.java",
+ "Annotations.java",
+ "DeprecatedParts.java",
+ "DumbClass.java",
+ "EnclosingMethod.java",
+ "PrivateMembersClass.java",
+ ],
+)
+
+# For testing purposes: an interface jar (ijar) which includes the
+# interface view of the various test class from above.
+genrule(
+ name = "interface_ijar_testlib",
+ srcs = [":ijar_testlib"],
+ outs = ["interface_ijar_testlib.jar"],
+ cmd = "$(location //third_party/ijar) $< $@",
+ tools = ["//third_party/ijar"],
+)
+
+java_library(
+ name = "typeannotations2",
+ srcs = glob(["typeannotations2/**/*.java"]),
+ javacopts = ["-source 8 -target 8"],
+)
+
+java_test(
+ name = "IjarTests",
+ size = "small",
+ srcs = [
+ "IjarTests.java",
+ "StripVerifyingVisitor.java",
+ ],
+ args = ["IjarTests"],
+ data = [
+ "PrivateNestedClass.java",
+ "UseDeprecatedParts.java",
+ "UseRestrictedAnnotation.java",
+ "package-info.java",
+ ":interface_ijar_testlib",
+ ],
+ deps = [
+ "//src/java_tools/buildjar:BazelJavaCompiler",
+ "//third_party:asm",
+ "//third_party:junit4",
+ ],
+)
+
+test_suite(
+ name = "all_tests",
+ testonly = 1,
+ visibility = ["//visibility:public"],
+)