Allow defining neverallow in packages other than android.

This exposes test func on ValueMatcher and helpers relevant for testing neverallows.

Bug: 153333044
Test: m
Change-Id: Ied07cd33afa537f9d7aa3c33e59f4ac985901a0f
This commit is contained in:
Artur Satayev
2020-04-09 16:06:36 +01:00
parent 2db1c3f1c4
commit c5570ac9b1
3 changed files with 12 additions and 12 deletions

View File

@@ -313,7 +313,7 @@ func TestNeverallow(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
// If the test has its own rules then use them instead of the default ones.
if test.rules != nil {
setTestNeverallowRules(config, test.rules)
SetTestNeverallowRules(config, test.rules)
}
_, errs := testNeverallow(config)
CheckErrorsAgainstExpectations(t, errs, test.expectedErrors)
@@ -327,7 +327,7 @@ func testNeverallow(config Config) (*TestContext, []error) {
ctx.RegisterModuleType("java_library", newMockJavaLibraryModule)
ctx.RegisterModuleType("java_library_host", newMockJavaLibraryModule)
ctx.RegisterModuleType("java_device_for_host", newMockJavaLibraryModule)
ctx.PostDepsMutators(registerNeverallowMutator)
ctx.PostDepsMutators(RegisterNeverallowMutator)
ctx.Register(config)
_, errs := ctx.ParseBlueprintsFiles("Android.bp")