Remove uses of FixtureFactory from android package

Bug: 183235980
Test: m nothing
Change-Id: I72898ada020ee1a73fd534c61afb5c22fa00c1e5
This commit is contained in:
Paul Duffin
2021-03-20 00:36:14 +00:00
parent ff2aa69a86
commit 30ac3e7ca7
24 changed files with 108 additions and 117 deletions

View File

@@ -56,11 +56,10 @@ func TestSingletonModule(t *testing.T) {
name: "test_singleton_module",
}
`
result := emptyTestFixtureFactory.
RunTest(t,
prepareForSingletonModuleTest,
FixtureWithRootAndroidBp(bp),
)
result := GroupFixturePreparers(
prepareForSingletonModuleTest,
FixtureWithRootAndroidBp(bp),
).RunTest(t)
ops := result.ModuleForTests("test_singleton_module", "").Module().(*testSingletonModule).ops
wantOps := []string{"GenerateAndroidBuildActions", "GenerateSingletonBuildActions", "MakeVars"}
@@ -78,19 +77,16 @@ func TestDuplicateSingletonModule(t *testing.T) {
}
`
emptyTestFixtureFactory.
prepareForSingletonModuleTest.
ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern([]string{
`\QDuplicate SingletonModule "test_singleton_module", previously used in\E`,
})).RunTest(t,
prepareForSingletonModuleTest,
FixtureWithRootAndroidBp(bp),
)
})).RunTestWithBp(t, bp)
}
func TestUnusedSingletonModule(t *testing.T) {
result := emptyTestFixtureFactory.RunTest(t,
result := GroupFixturePreparers(
prepareForSingletonModuleTest,
)
).RunTest(t)
singleton := result.SingletonForTests("test_singleton_module").Singleton()
sm := singleton.(*singletonModuleSingletonAdaptor).sm
@@ -113,17 +109,16 @@ func TestVariantSingletonModule(t *testing.T) {
}
`
emptyTestFixtureFactory.
GroupFixturePreparers(
prepareForSingletonModuleTest,
FixtureRegisterWithContext(func(ctx RegistrationContext) {
ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
ctx.BottomUp("test_singleton_module_mutator", testVariantSingletonModuleMutator)
})
}),
).
ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern([]string{
`\QGenerateAndroidBuildActions already called for variant\E`,
})).
RunTest(t,
prepareForSingletonModuleTest,
FixtureRegisterWithContext(func(ctx RegistrationContext) {
ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
ctx.BottomUp("test_singleton_module_mutator", testVariantSingletonModuleMutator)
})
}),
FixtureWithRootAndroidBp(bp),
)
RunTestWithBp(t, bp)
}