Simplify preparers now that tests use consistent registration order
It is no longer necessary to use preparers in a specific order now that the test infrastructure enforces a consistent registration order. So, this change: * Sorts preparers alphabetically to make them easier to maintain. * Creates a single visiblity preparer for all the visibility mutators. * Adds PrepareForTestWithPackageModule Bug: 181070625 Bug: 181953909 Test: m nothing Change-Id: I9e65dd182be664d8d0d5db7ccc0b63fa315129c8
This commit is contained in:
@@ -202,17 +202,14 @@ type ExcludeFromVisibilityEnforcementTag interface {
|
||||
ExcludeFromVisibilityEnforcement()
|
||||
}
|
||||
|
||||
var PrepareForTestWithVisibilityRuleChecker = FixtureRegisterWithContext(func(ctx RegistrationContext) {
|
||||
// The visibility mutators.
|
||||
var PrepareForTestWithVisibility = FixtureRegisterWithContext(registerVisibilityMutators)
|
||||
|
||||
func registerVisibilityMutators(ctx RegistrationContext) {
|
||||
ctx.PreArchMutators(RegisterVisibilityRuleChecker)
|
||||
})
|
||||
|
||||
var PrepareForTestWithVisibilityRuleGatherer = FixtureRegisterWithContext(func(ctx RegistrationContext) {
|
||||
ctx.PreArchMutators(RegisterVisibilityRuleGatherer)
|
||||
})
|
||||
|
||||
var PrepareForTestWithVisibilityRuleEnforcer = FixtureRegisterWithContext(func(ctx RegistrationContext) {
|
||||
ctx.PostDepsMutators(RegisterVisibilityRuleEnforcer)
|
||||
})
|
||||
}
|
||||
|
||||
// The rule checker needs to be registered before defaults expansion to correctly check that
|
||||
// //visibility:xxx isn't combined with other packages in the same list in any one module.
|
||||
|
Reference in New Issue
Block a user