Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/rules/android_binary/r8_integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
26 changes: 26 additions & 0 deletions test/rules/android_binary/r8_integration/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)