Merge "Prevent using android_app_import in instrumentation_for property" am: da88a2599a
am: 4a2fbb6a17
am: 2c7ba94992
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1945101 Change-Id: Ic36a72fd6ee00eb3737bcc161da49c657b7a9551
This commit is contained in:
@@ -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)
|
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) {
|
func TestStl(t *testing.T) {
|
||||||
ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
|
ctx, _ := testJava(t, cc.GatherRequiredDepsForTest(android.Android)+`
|
||||||
cc_library {
|
cc_library {
|
||||||
|
@@ -1945,6 +1945,9 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
|
|||||||
sm := module.(SystemModulesProvider)
|
sm := module.(SystemModulesProvider)
|
||||||
outputDir, outputDeps := sm.OutputDirAndDeps()
|
outputDir, outputDeps := sm.OutputDirAndDeps()
|
||||||
deps.systemModules = &systemModules{outputDir, outputDeps}
|
deps.systemModules = &systemModules{outputDir, outputDeps}
|
||||||
|
|
||||||
|
case instrumentationForTag:
|
||||||
|
ctx.PropertyErrorf("instrumentation_for", "dependency %q of type %q does not provide JavaInfo so is unsuitable for use with this property", ctx.OtherModuleName(module), ctx.OtherModuleType(module))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user