diff options
| author | 2021-02-27 11:59:02 +0000 | |
|---|---|---|
| committer | 2021-03-02 20:17:19 +0000 | |
| commit | cfd3374da03da06646fb209583178dbd718129dd (patch) | |
| tree | 1e55e1db445fff25a71b0c22df7ea2b95cbbd3d4 /android/visibility.go | |
| parent | 4416350471d56433ca30ffab4bcf4eaeff32741d (diff) | |
Add error handling to test fixtures
Adds support for customizing the error handling behavior of test
fixtures and converts a test to use it.
Bug: 181070625
Test: m nothing
Change-Id: I736c41311819d57d8688fc3b0e021dbb50c491c1
Diffstat (limited to 'android/visibility.go')
| -rw-r--r-- | android/visibility.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/android/visibility.go b/android/visibility.go index 7eac47166..631e88ff9 100644 --- a/android/visibility.go +++ b/android/visibility.go @@ -202,6 +202,18 @@ type ExcludeFromVisibilityEnforcementTag interface { ExcludeFromVisibilityEnforcement() } +var PrepareForTestWithVisibilityRuleChecker = FixtureRegisterWithContext(func(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. func RegisterVisibilityRuleChecker(ctx RegisterMutatorsContext) { |