diff options
| author | 2022-01-13 12:54:14 +0000 | |
|---|---|---|
| committer | 2022-01-13 12:54:14 +0000 | |
| commit | ad103d80baf5bca005cf1c2be0fa8d58be8c3106 (patch) | |
| tree | f902188e57156e24e55dcff33cfa44b92ad1730d /java/app_test.go | |
| parent | f0a0efdd12f6cf96b56cd130fea68066b7df8be2 (diff) | |
| parent | 7d009dd8a824a6573b71421af5559714ac8bc87a (diff) | |
Merge "Prevent using android_app_import in instrumentation_for property" am: da88a2599a am: 4a2fbb6a17 am: 2c7ba94992 am: 7d009dd8a8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1945101
Change-Id: I6d020f9267740539ed45d479792847dff17741dc
Diffstat (limited to 'java/app_test.go')
| -rw-r--r-- | java/app_test.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/java/app_test.go b/java/app_test.go index 7e068385b..0a76bbcc5 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -2261,10 +2261,33 @@ func TestAndroidTest_FixTestConfig(t *testing.T) { t.Errorf("test_config_fixer was not expected to run, but did: %q", params.RuleParams.Command) } } - } } +func TestInstrumentationTargetPrebuilt(t *testing.T) { + bp := ` + android_app_import { + name: "foo", + apk: "foo.apk", + presigned: true, + } + + android_test { + name: "bar", + srcs: ["a.java"], + instrumentation_for: "foo", + sdk_version: "current", + } + ` + + android.GroupFixturePreparers( + PrepareForTestWithJavaDefaultModules, + ).ExtendWithErrorHandler( + android.FixtureExpectsAtLeastOneErrorMatchingPattern( + "instrumentation_for: dependency \"foo\" of type \"android_app_import\" does not provide JavaInfo so is unsuitable for use with this property")). + RunTestWithBp(t, bp) +} + func TestStl(t *testing.T) { ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+` cc_library { |