|
3 | 3 | load("@rules_testing//lib:analysis_test.bzl", "analysis_test", "test_suite") |
4 | 4 | load("@rules_testing//lib:util.bzl", "util") |
5 | 5 | load("//java:java_library.bzl", "java_library") |
| 6 | +load("//java/common:java_common.bzl", "java_common") |
| 7 | +load("//java/common:java_plugin_info.bzl", "JavaPluginInfo") |
6 | 8 | load("//java/test/testutil:java_info_subject.bzl", "java_info_subject") |
7 | 9 | load("//java/test/testutil:rules/custom_library.bzl", "custom_library") |
8 | 10 | load("//java/test/testutil:rules/custom_library_with_exports.bzl", "custom_library_with_exports") |
@@ -58,12 +60,27 @@ def _test_compile_exports_no_sources_impl(env, target): |
58 | 60 | ["{package}/libjl.jar"], |
59 | 61 | ) |
60 | 62 |
|
| 63 | +def _test_java_plugin_info(name): |
| 64 | + util.helper_target(native.filegroup, name = name + "/dummy") |
| 65 | + analysis_test( |
| 66 | + name = name, |
| 67 | + impl = _test_java_plugin_info_impl, |
| 68 | + target = name + "/dummy", # analysis_test always expects a target |
| 69 | + ) |
| 70 | + |
| 71 | +def _test_java_plugin_info_impl(env, _target): |
| 72 | + env.expect.that_bool( |
| 73 | + java_common.JavaPluginInfo == JavaPluginInfo, |
| 74 | + "java_common.JavaPluginInfo == JavaPluginInfo", |
| 75 | + ).equals(True) |
| 76 | + |
61 | 77 | def java_common_tests(name): |
62 | 78 | test_suite( |
63 | 79 | name = name, |
64 | 80 | tests = [ |
65 | 81 | _test_compile_default_values, |
66 | 82 | _test_compile_sourcepath, |
67 | 83 | _test_compile_exports_no_sources, |
| 84 | + _test_java_plugin_info, |
68 | 85 | ], |
69 | 86 | ) |
0 commit comments