Fix prebuilt mutator ordering in tests

Previously, the prebuilt mutators were added by the
cc.RegisterRequiredBuildComponentsForTest() function as a convenience
but unfortunately it lead to some of the mutators being in a different
order in the tests than in the normal build.

This change:
* Extracts the RegisterPrebuiltMutators() call from
  cc.RegisterRequiredBuildComponentsForTest()
* Makes sure that the prebuilt mutators are registered before the
  visibility gatherer and enforcer mutators.

Bug: 162505935
Test: m nothing
Change-Id: I7d959b558200b502f0a5e4653c41ea01414e142a
This commit is contained in:
Paul Duffin
2020-07-30 16:04:17 +01:00
parent 359d4f3374
commit 021f4e525f
6 changed files with 17 additions and 5 deletions

View File

@@ -77,6 +77,7 @@ func GatherRequiredDepsForTest() string {
func CreateTestContext() *android.TestContext {
ctx := android.NewTestArchContext()
android.RegisterPrebuiltMutators(ctx)
cc.RegisterRequiredBuildComponentsForTest(ctx)
ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
ctx.RegisterModuleType("rust_binary", RustBinaryFactory)