diff --git a/android/android_test.go b/android/android_test.go index 2a697fb85..fb82e3765 100644 --- a/android/android_test.go +++ b/android/android_test.go @@ -22,5 +22,3 @@ import ( func TestMain(m *testing.M) { os.Exit(m.Run()) } - -var emptyTestFixtureFactory = NewFixtureFactory(nil) diff --git a/android/androidmk_test.go b/android/androidmk_test.go index 230b1ec0b..8eda9b247 100644 --- a/android/androidmk_test.go +++ b/android/androidmk_test.go @@ -141,14 +141,14 @@ func customModuleFactory() Module { // bp module and then returns the config and the custom module called "foo". func buildContextAndCustomModuleFoo(t *testing.T, bp string) (*TestContext, *customModule) { t.Helper() - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( // Enable androidmk Singleton PrepareForTestWithAndroidMk, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("custom", customModuleFactory) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) module := result.ModuleForTests("foo", "").Module().(*customModule) return result.TestContext, module diff --git a/android/arch_test.go b/android/arch_test.go index 09cb52370..633ddaa99 100644 --- a/android/arch_test.go +++ b/android/arch_test.go @@ -358,12 +358,12 @@ func TestArchMutator(t *testing.T) { for _, tt := range testCases { t.Run(tt.name, func(t *testing.T) { - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( prepareForArchTest, // Test specific preparer OptionalFixturePreparer(tt.preparer), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) ctx := result.TestContext if g, w := enabledVariants(ctx, "foo"), tt.fooVariants; !reflect.DeepEqual(w, g) { @@ -441,7 +441,7 @@ func TestArchMutatorNativeBridge(t *testing.T) { for _, tt := range testCases { t.Run(tt.name, func(t *testing.T) { - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( prepareForArchTest, // Test specific preparer OptionalFixturePreparer(tt.preparer), @@ -455,7 +455,7 @@ func TestArchMutatorNativeBridge(t *testing.T) { } }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) ctx := result.TestContext diff --git a/android/csuite_config_test.go b/android/csuite_config_test.go index d30ff6926..b8a176eb3 100644 --- a/android/csuite_config_test.go +++ b/android/csuite_config_test.go @@ -19,14 +19,14 @@ import ( ) func TestCSuiteConfig(t *testing.T) { - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( PrepareForTestWithArchMutator, FixtureRegisterWithContext(registerCSuiteBuildComponents), FixtureWithRootAndroidBp(` csuite_config { name: "plain"} csuite_config { name: "with_manifest", test_config: "manifest.xml" } `), - ) + ).RunTest(t) variants := result.ModuleVariantsForTests("plain") if len(variants) > 1 { diff --git a/android/defaults_test.go b/android/defaults_test.go index b33cb527c..a7542abb3 100644 --- a/android/defaults_test.go +++ b/android/defaults_test.go @@ -83,10 +83,10 @@ func TestDefaults(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( prepareForDefaultsTest, FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) foo := result.Module("foo", "").(*defaultsTestModule) @@ -114,11 +114,11 @@ func TestDefaultsAllowMissingDependencies(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( prepareForDefaultsTest, PrepareForTestWithAllowMissingDependencies, FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) missingDefaults := result.ModuleForTests("missing_defaults", "").Output("out") missingTransitiveDefaults := result.ModuleForTests("missing_transitive_defaults", "").Output("out") diff --git a/android/deptag_test.go b/android/deptag_test.go index 7f5589659..eb4fa89a6 100644 --- a/android/deptag_test.go +++ b/android/deptag_test.go @@ -80,13 +80,13 @@ func TestInstallDependencyTag(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( PrepareForTestWithArchMutator, FixtureWithRootAndroidBp(bp), FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("test_module", testInstallDependencyTagModuleFactory) }), - ) + ).RunTest(t) config := result.Config diff --git a/android/license_kind_test.go b/android/license_kind_test.go index 83e83cef8..1f09568db 100644 --- a/android/license_kind_test.go +++ b/android/license_kind_test.go @@ -97,13 +97,14 @@ var licenseKindTests = []struct { func TestLicenseKind(t *testing.T) { for _, test := range licenseKindTests { t.Run(test.name, func(t *testing.T) { - licenseTestFixtureFactory. - Extend( - FixtureRegisterWithContext(func(ctx RegistrationContext) { - ctx.RegisterModuleType("mock_license", newMockLicenseModule) - }), - test.fs.AddToFixture(), - ).ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(test.expectedErrors)). + GroupFixturePreparers( + prepareForLicenseTest, + FixtureRegisterWithContext(func(ctx RegistrationContext) { + ctx.RegisterModuleType("mock_license", newMockLicenseModule) + }), + test.fs.AddToFixture(), + ). + ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(test.expectedErrors)). RunTest(t) }) } diff --git a/android/license_test.go b/android/license_test.go index a564827e6..2b09a4f69 100644 --- a/android/license_test.go +++ b/android/license_test.go @@ -5,7 +5,7 @@ import ( ) // Common test set up for license tests. -var licenseTestFixtureFactory = emptyTestFixtureFactory.Extend( +var prepareForLicenseTest = GroupFixturePreparers( // General preparers in alphabetical order. PrepareForTestWithDefaults, prepareForTestWithLicenses, @@ -179,7 +179,8 @@ func TestLicense(t *testing.T) { for _, test := range licenseTests { t.Run(test.name, func(t *testing.T) { // Customize the common license text fixture factory. - licenseTestFixtureFactory.Extend( + GroupFixturePreparers( + prepareForLicenseTest, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("rule", newMockRuleModule) }), diff --git a/android/licenses_test.go b/android/licenses_test.go index a581932bd..913dc8842 100644 --- a/android/licenses_test.go +++ b/android/licenses_test.go @@ -470,7 +470,8 @@ func TestLicenses(t *testing.T) { for _, test := range licensesTests { t.Run(test.name, func(t *testing.T) { // Customize the common license text fixture factory. - result := licenseTestFixtureFactory.Extend( + result := GroupFixturePreparers( + prepareForLicenseTest, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("mock_bad_module", newMockLicensesBadModule) ctx.RegisterModuleType("mock_library", newMockLicensesLibraryModule) diff --git a/android/module_test.go b/android/module_test.go index 99bf30afc..9ac929179 100644 --- a/android/module_test.go +++ b/android/module_test.go @@ -179,11 +179,9 @@ func TestErrorDependsOnDisabledModule(t *testing.T) { } ` - emptyTestFixtureFactory. + prepareForModuleTests. ExtendWithErrorHandler(FixtureExpectsAtLeastOneErrorMatchingPattern(`module "foo": depends on disabled module "bar"`)). - RunTest(t, - prepareForModuleTests, - FixtureWithRootAndroidBp(bp)) + RunTestWithBp(t, bp) } func TestValidateCorrectBuildParams(t *testing.T) { @@ -268,9 +266,7 @@ func TestDistErrorChecking(t *testing.T) { "\\QAndroid.bp:18:17: module \"foo\": dists[1].suffix: Suffix may not contain a '/' character.\\E", } - emptyTestFixtureFactory. + prepareForModuleTests. ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(expectedErrs)). - RunTest(t, - prepareForModuleTests, - FixtureWithRootAndroidBp(bp)) + RunTestWithBp(t, bp) } diff --git a/android/mutator_test.go b/android/mutator_test.go index 46d26d1be..21eebd2c8 100644 --- a/android/mutator_test.go +++ b/android/mutator_test.go @@ -65,7 +65,7 @@ func TestMutatorAddMissingDependencies(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( PrepareForTestWithAllowMissingDependencies, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("test", mutatorTestModuleFactory) @@ -74,7 +74,7 @@ func TestMutatorAddMissingDependencies(t *testing.T) { }) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) foo := result.ModuleForTests("foo", "").Module().(*mutatorTestModule) @@ -90,7 +90,7 @@ func TestModuleString(t *testing.T) { var moduleStrings []string - emptyTestFixtureFactory.RunTest(t, + GroupFixturePreparers( FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.PreArchMutators(func(ctx RegisterMutatorsContext) { @@ -128,7 +128,7 @@ func TestModuleString(t *testing.T) { ctx.RegisterModuleType("test", mutatorTestModuleFactory) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) want := []string{ // Initial name. @@ -187,7 +187,7 @@ func TestFinalDepsPhase(t *testing.T) { finalGot := map[string]int{} - emptyTestFixtureFactory.RunTest(t, + GroupFixturePreparers( FixtureRegisterWithContext(func(ctx RegistrationContext) { dep1Tag := struct { blueprint.BaseDependencyTag @@ -224,7 +224,7 @@ func TestFinalDepsPhase(t *testing.T) { ctx.RegisterModuleType("test", mutatorTestModuleFactory) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) finalWant := map[string]int{ "common_dep_1{variant:a}": 1, @@ -249,7 +249,7 @@ func TestNoCreateVariationsInFinalDeps(t *testing.T) { } } - emptyTestFixtureFactory.RunTest(t, + GroupFixturePreparers( FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.FinalDepsMutators(func(ctx RegisterMutatorsContext) { ctx.BottomUp("vars", func(ctx BottomUpMutatorContext) { @@ -265,5 +265,5 @@ func TestNoCreateVariationsInFinalDeps(t *testing.T) { ctx.RegisterModuleType("test", mutatorTestModuleFactory) }), FixtureWithRootAndroidBp(`test {name: "foo"}`), - ) + ).RunTest(t) } diff --git a/android/namespace_test.go b/android/namespace_test.go index 1caf5a87f..dea287d84 100644 --- a/android/namespace_test.go +++ b/android/namespace_test.go @@ -633,21 +633,21 @@ func mockFiles(bps map[string]string) (files map[string][]byte) { } func setupTestFromFiles(t *testing.T, bps MockFS) (ctx *TestContext, errs []error) { - result := emptyTestFixtureFactory. + result := GroupFixturePreparers( + FixtureModifyContext(func(ctx *TestContext) { + ctx.RegisterModuleType("test_module", newTestModule) + ctx.RegisterModuleType("soong_namespace", NamespaceFactory) + ctx.Context.RegisterModuleType("blueprint_test_module", newBlueprintTestModule) + ctx.PreArchMutators(RegisterNamespaceMutator) + ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) { + ctx.BottomUp("rename", renameMutator) + }) + }), + bps.AddToFixture(), + ). // Ignore errors for now so tests can check them later. ExtendWithErrorHandler(FixtureIgnoreErrors). - RunTest(t, - FixtureModifyContext(func(ctx *TestContext) { - ctx.RegisterModuleType("test_module", newTestModule) - ctx.RegisterModuleType("soong_namespace", NamespaceFactory) - ctx.Context.RegisterModuleType("blueprint_test_module", newBlueprintTestModule) - ctx.PreArchMutators(RegisterNamespaceMutator) - ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) { - ctx.BottomUp("rename", renameMutator) - }) - }), - bps.AddToFixture(), - ) + RunTest(t) return result.TestContext, result.Errs } diff --git a/android/neverallow_test.go b/android/neverallow_test.go index 5ac97e775..b8ef0f5f2 100644 --- a/android/neverallow_test.go +++ b/android/neverallow_test.go @@ -299,18 +299,17 @@ var prepareForNeverAllowTest = GroupFixturePreparers( func TestNeverallow(t *testing.T) { for _, test := range neverallowTests { t.Run(test.name, func(t *testing.T) { - emptyTestFixtureFactory. - ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(test.expectedErrors)). - RunTest(t, - prepareForNeverAllowTest, - FixtureModifyConfig(func(config Config) { - // If the test has its own rules then use them instead of the default ones. - if test.rules != nil { - SetTestNeverallowRules(config, test.rules) - } - }), - test.fs.AddToFixture(), - ) + GroupFixturePreparers( + prepareForNeverAllowTest, + FixtureModifyConfig(func(config Config) { + // If the test has its own rules then use them instead of the default ones. + if test.rules != nil { + SetTestNeverallowRules(config, test.rules) + } + }), + test.fs.AddToFixture(), + ).ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(test.expectedErrors)). + RunTest(t) }) } } diff --git a/android/ninja_deps_test.go b/android/ninja_deps_test.go index 7e5864d5b..947c25726 100644 --- a/android/ninja_deps_test.go +++ b/android/ninja_deps_test.go @@ -57,13 +57,13 @@ func TestNinjaDeps(t *testing.T) { "test_ninja_deps/exists": nil, } - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterSingletonType("test_ninja_deps_singleton", testNinjaDepsSingletonFactory) ctx.RegisterSingletonType("ninja_deps_singleton", ninjaDepsSingletonFactory) }), fs.AddToFixture(), - ) + ).RunTest(t) // Verify that the ninja file has a dependency on the test_ninja_deps directory. if g, w := result.NinjaDeps, "test_ninja_deps"; !InList(w, g) { diff --git a/android/package_test.go b/android/package_test.go index d5b4db4a8..3bd30cc93 100644 --- a/android/package_test.go +++ b/android/package_test.go @@ -61,13 +61,13 @@ var packageTests = []struct { func TestPackage(t *testing.T) { for _, test := range packageTests { t.Run(test.name, func(t *testing.T) { - emptyTestFixtureFactory. + GroupFixturePreparers( + PrepareForTestWithArchMutator, + PrepareForTestWithPackageModule, + test.fs.AddToFixture(), + ). ExtendWithErrorHandler(FixtureExpectsAllErrorsToMatchAPattern(test.expectedErrors)). - RunTest(t, - PrepareForTestWithArchMutator, - PrepareForTestWithPackageModule, - test.fs.AddToFixture(), - ) + RunTest(t) }) } } diff --git a/android/packaging_test.go b/android/packaging_test.go index eb7f26fb8..f29de767c 100644 --- a/android/packaging_test.go +++ b/android/packaging_test.go @@ -96,14 +96,14 @@ func runPackagingTest(t *testing.T, multitarget bool, bp string, expected []stri moduleFactory = packageTestModuleFactory } - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( PrepareForTestWithArchMutator, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("component", componentTestModuleFactory) ctx.RegisterModuleType("package_module", moduleFactory) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) p := result.Module("package", archVariant).(*packageTestModule) actual := p.entries diff --git a/android/path_properties_test.go b/android/path_properties_test.go index 8726ea77f..568f8682b 100644 --- a/android/path_properties_test.go +++ b/android/path_properties_test.go @@ -157,14 +157,14 @@ func TestPathDepsMutator(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( PrepareForTestWithArchMutator, PrepareForTestWithFilegroup, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("test", pathDepsMutatorTestModuleFactory) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) m := result.Module("foo", "android_arm64_armv8-a").(*pathDepsMutatorTestModule) diff --git a/android/paths_test.go b/android/paths_test.go index c5fc10ebb..465ea3b55 100644 --- a/android/paths_test.go +++ b/android/paths_test.go @@ -1005,14 +1005,14 @@ func testPathForModuleSrc(t *testing.T, tests []pathForModuleSrcTestCase) { "foo/src_special/$": nil, } - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("test", pathForModuleSrcTestModuleFactory) ctx.RegisterModuleType("output_file_provider", pathForModuleSrcOutputFileProviderModuleFactory) ctx.RegisterModuleType("filegroup", FileGroupFactory) }), mockFS.AddToFixture(), - ) + ).RunTest(t) m := result.ModuleForTests("foo", "").Module().(*pathForModuleSrcTestModule) @@ -1203,13 +1203,13 @@ func TestPathsForModuleSrc_AllowMissingDependencies(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( PrepareForTestWithAllowMissingDependencies, FixtureRegisterWithContext(func(ctx RegistrationContext) { ctx.RegisterModuleType("test", pathForModuleSrcTestModuleFactory) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) foo := result.ModuleForTests("foo", "").Module().(*pathForModuleSrcTestModule) diff --git a/android/prebuilt_test.go b/android/prebuilt_test.go index 32af5df4b..ced37fe64 100644 --- a/android/prebuilt_test.go +++ b/android/prebuilt_test.go @@ -284,7 +284,7 @@ func TestPrebuilts(t *testing.T) { t.Errorf("windows is assumed to be disabled by default") } - result := emptyTestFixtureFactory.Extend( + result := GroupFixturePreparers( PrepareForTestWithArchMutator, PrepareForTestWithPrebuilts, PrepareForTestWithOverrides, diff --git a/android/rule_builder_test.go b/android/rule_builder_test.go index 3415aed1f..f41d61b49 100644 --- a/android/rule_builder_test.go +++ b/android/rule_builder_test.go @@ -542,11 +542,11 @@ func TestRuleBuilder_Build(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( prepareForRuleBuilderTest, FixtureWithRootAndroidBp(bp), fs.AddToFixture(), - ) + ).RunTest(t) check := func(t *testing.T, params TestingBuildParams, wantCommand, wantOutput, wantDepfile string, wantRestat bool, extraImplicits, extraCmdDeps []string) { t.Helper() @@ -651,10 +651,10 @@ func TestRuleBuilderHashInputs(t *testing.T) { }, } - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( prepareForRuleBuilderTest, FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) for _, test := range testcases { t.Run(test.name, func(t *testing.T) { 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) } diff --git a/android/soong_config_modules_test.go b/android/soong_config_modules_test.go index a72b160c0..8f252d944 100644 --- a/android/soong_config_modules_test.go +++ b/android/soong_config_modules_test.go @@ -278,7 +278,7 @@ func TestSoongConfigModule(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( tc.preparer, PrepareForTestWithDefaults, FixtureRegisterWithContext(func(ctx RegistrationContext) { @@ -291,7 +291,7 @@ func TestSoongConfigModule(t *testing.T) { }), fs.AddToFixture(), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) foo := result.ModuleForTests("foo", "").Module().(*soongConfigTestModule) AssertDeepEquals(t, "foo cflags", tc.fooExpectedFlags, foo.props.Cflags) diff --git a/android/variable_test.go b/android/variable_test.go index d16e45880..928bca609 100644 --- a/android/variable_test.go +++ b/android/variable_test.go @@ -182,7 +182,7 @@ func TestProductVariables(t *testing.T) { } ` - emptyTestFixtureFactory.RunTest(t, + GroupFixturePreparers( FixtureModifyProductVariables(func(variables FixtureProductVariables) { variables.Eng = proptools.BoolPtr(true) }), @@ -204,7 +204,7 @@ func TestProductVariables(t *testing.T) { }) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) } var testProductVariableDefaultsProperties = struct { @@ -288,7 +288,7 @@ func TestProductVariablesDefaults(t *testing.T) { } ` - result := emptyTestFixtureFactory.RunTest(t, + result := GroupFixturePreparers( FixtureModifyProductVariables(func(variables FixtureProductVariables) { variables.Eng = boolPtr(true) }), @@ -299,7 +299,7 @@ func TestProductVariablesDefaults(t *testing.T) { ctx.RegisterModuleType("defaults", productVariablesDefaultsTestDefaultsFactory) }), FixtureWithRootAndroidBp(bp), - ) + ).RunTest(t) foo := result.ModuleForTests("foo", "").Module().(*productVariablesDefaultsTestModule) diff --git a/android/visibility_test.go b/android/visibility_test.go index fdf18ce00..ffd79093e 100644 --- a/android/visibility_test.go +++ b/android/visibility_test.go @@ -1142,7 +1142,7 @@ var visibilityTests = []struct { func TestVisibility(t *testing.T) { for _, test := range visibilityTests { t.Run(test.name, func(t *testing.T) { - result := emptyTestFixtureFactory.Extend( + result := GroupFixturePreparers( // General preparers in alphabetical order as test infrastructure will enforce correct // registration order. PrepareForTestWithArchMutator,