Move coverage builds prebuilt special case to make
Having this in make has the following advantages - allows this to be used in other places in make that are sensitive to prebuilt selection, e.g. apex boot jars that are present in source but not in prebuilt apexes - collocates the various prebuilt special edge cases Test: presubmits Test: in internal, lunch cf_x86_64_phone-next-userdebug Test: EMMA_INSTRUMENT_FRAMEWORK=true get_build_var PRODUCT_BUILD_IGNORE_APEX_CONTRIBUTION_CONTENTS true Bug: 308188056 Change-Id: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde Merged-In: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde
This commit is contained in:
@@ -610,45 +610,3 @@ func TestPrebuiltErrorCannotListBothSourceAndPrebuiltInContributions(t *testing.
|
||||
}
|
||||
`, selectMainlineModuleContritbutions)
|
||||
}
|
||||
|
||||
// Test that apex_contributions of prebuilt modules are ignored in coverage builds
|
||||
func TestSourceIsSelectedInCoverageBuilds(t *testing.T) {
|
||||
prebuiltMainlineContributions := GroupFixturePreparers(
|
||||
FixtureModifyProductVariables(func(variables FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "my_prebuilt_apex_contributions",
|
||||
}
|
||||
}),
|
||||
FixtureMergeEnv(map[string]string{
|
||||
"EMMA_INSTRUMENT_FRAMEWORK": "true",
|
||||
}),
|
||||
)
|
||||
bp := `
|
||||
source {
|
||||
name: "foo",
|
||||
}
|
||||
prebuilt {
|
||||
name: "foo",
|
||||
srcs: ["prebuilt_file"],
|
||||
}
|
||||
apex_contributions {
|
||||
name: "my_prebuilt_apex_contributions",
|
||||
api_domain: "my_mainline_module",
|
||||
contents: [
|
||||
"prebuilt_foo",
|
||||
],
|
||||
}
|
||||
all_apex_contributions {
|
||||
name: "all_apex_contributions",
|
||||
}
|
||||
`
|
||||
ctx := GroupFixturePreparers(
|
||||
PrepareForTestWithArchMutator,
|
||||
PrepareForTestWithPrebuilts,
|
||||
FixtureRegisterWithContext(registerTestPrebuiltModules),
|
||||
prebuiltMainlineContributions).RunTestWithBp(t, bp)
|
||||
source := ctx.ModuleForTests("foo", "android_common").Module()
|
||||
AssertBoolEquals(t, "Source should be preferred in coverage builds", true, !source.IsHideFromMake())
|
||||
prebuilt := ctx.ModuleForTests("prebuilt_foo", "android_common").Module()
|
||||
AssertBoolEquals(t, "Prebuilt should not be preferred in coverage builds", false, !prebuilt.IsHideFromMake())
|
||||
}
|
||||
|
Reference in New Issue
Block a user