diff --git a/test/rules/android_binary/r8_integration/BUILD b/test/rules/android_binary/r8_integration/BUILD index 413446ecc..7e444a587 100644 --- a/test/rules/android_binary/r8_integration/BUILD +++ b/test/rules/android_binary/r8_integration/BUILD @@ -6,7 +6,7 @@ load( ) load("@rules_python//python:py_test.bzl", "py_test") load("@rules_shell//shell:sh_library.bzl", "sh_library") -load(":test.bzl", "r8_neverlink_deps_test") +load(":test.bzl", "r8_implicit_outputs_test", "r8_neverlink_deps_test") py_test( name = "r8_integration_test", @@ -21,6 +21,11 @@ py_test( ], ) +r8_implicit_outputs_test( + name = "r8_implicit_outputs_test", + target_under_test = "//test/rules/android_binary/r8_integration/java/com/neverlink:android_binary_with_neverlink_deps", +) + r8_neverlink_deps_test( name = "r8_neverlink_deps_test", target_under_test = "//test/rules/android_binary/r8_integration/java/com/neverlink:android_binary_with_neverlink_deps", diff --git a/test/rules/android_binary/r8_integration/test.bzl b/test/rules/android_binary/r8_integration/test.bzl index 327047408..1bbe6f257 100644 --- a/test/rules/android_binary/r8_integration/test.bzl +++ b/test/rules/android_binary/r8_integration/test.bzl @@ -55,3 +55,29 @@ def r8_neverlink_deps_test_impl(ctx): r8_neverlink_deps_test = analysistest.make( impl = r8_neverlink_deps_test_impl, ) + +def r8_implicit_outputs_test_impl(ctx): + """Tests that R8 declares proguard_mappings_output_file as implicit_outputs. + + Args: + ctx: The ctx. + + Returns: + The providers. + """ + env = analysistest.begin(ctx) + target = analysistest.target_under_test(env) + + default_files = [f.basename for f in target[DefaultInfo].files.to_list()] + expected_map = target.label.name + "_proguard.map" + asserts.true( + env, + expected_map in default_files, + "Expected %s to be in default outputs %s" % (expected_map, default_files), + ) + + return analysistest.end(env) + +r8_implicit_outputs_test = analysistest.make( + impl = r8_implicit_outputs_test_impl, +)