summaryrefslogtreecommitdiff
path: root/android/singleton_module_test.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-03-20 00:36:14 +0000
committer Paul Duffin <paulduffin@google.com> 2021-03-22 18:31:53 +0000
commit30ac3e7ca75106d7f883558c46501296d4bffcfc (patch)
tree8fb0fadf5f85ff592c7ff56bdfb0a915d9ffa1b1 /android/singleton_module_test.go
parentff2aa69a86e46429255ed812b2796a89635b9f26 (diff)
Remove uses of FixtureFactory from android package
Bug: 183235980 Test: m nothing Change-Id: I72898ada020ee1a73fd534c61afb5c22fa00c1e5
Diffstat (limited to 'android/singleton_module_test.go')
-rw-r--r--android/singleton_module_test.go39
1 files changed, 17 insertions, 22 deletions
diff --git a/android/singleton_module_test.go b/android/singleton_module_test.go
index 41dd4bb48..eb5554c01 100644
--- a/android/singleton_module_test.go
+++ b/android/singleton_module_test.go
@@ -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)
}