diff options
| author | 2022-01-13 11:56:52 +0000 | |
|---|---|---|
| committer | 2022-01-13 11:56:52 +0000 | |
| commit | da88a2599a4d5e95e250803f7346e879d501b578 (patch) | |
| tree | f6dd71d40bb6c2c42e3dd4823cc58aa93c4fe009 /java/app_test.go | |
| parent | 3a1a4b070e1901385b60887b2103415a5d83312a (diff) | |
| parent | 53a70a4870067b68cdad71ff9bbd03db545086c5 (diff) | |
Merge "Prevent using android_app_import in instrumentation_for property"
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 d9667b980..2322ef44e 100644 --- a/java/app_test.go +++ b/java/app_test.go @@ -2258,10 +2258,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 { |