diff options
Diffstat (limited to 'dexpreopt/testing.go')
| -rw-r--r-- | dexpreopt/testing.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dexpreopt/testing.go b/dexpreopt/testing.go index 6ed0736f7..b1fbef566 100644 --- a/dexpreopt/testing.go +++ b/dexpreopt/testing.go @@ -88,6 +88,15 @@ var PrepareForTestByEnablingDexpreopt = android.GroupFixturePreparers( FixtureModifyGlobalConfig(func(android.PathContext, *GlobalConfig) {}), ) +var PrepareForTestWithDexpreoptConfig = android.GroupFixturePreparers( + android.PrepareForTestWithAndroidBuildComponents, + android.FixtureModifyContext(func(ctx *android.TestContext) { + ctx.RegisterParallelSingletonType("dexpreopt-soong-config", func() android.Singleton { + return &globalSoongConfigSingleton{} + }) + }), +) + // FixtureModifyGlobalConfig enables dexpreopt (unless modified by the mutator) and modifies the // configuration. func FixtureModifyGlobalConfig(configModifier func(ctx android.PathContext, dexpreoptConfig *GlobalConfig)) android.FixturePreparer { @@ -111,6 +120,13 @@ func FixtureSetArtBootJars(bootJars ...string) android.FixturePreparer { }) } +// FixtureSetTestOnlyArtBootImageJars enables dexpreopt and sets the TestOnlyArtBootImageJars property. +func FixtureSetTestOnlyArtBootImageJars(bootJars ...string) android.FixturePreparer { + return FixtureModifyGlobalConfig(func(_ android.PathContext, dexpreoptConfig *GlobalConfig) { + dexpreoptConfig.TestOnlyArtBootImageJars = android.CreateTestConfiguredJarList(bootJars) + }) +} + // FixtureSetBootJars enables dexpreopt and sets the BootJars property. func FixtureSetBootJars(bootJars ...string) android.FixturePreparer { return FixtureModifyGlobalConfig(func(_ android.PathContext, dexpreoptConfig *GlobalConfig) { @@ -188,3 +204,10 @@ func FixtureDisableDexpreopt(disable bool) android.FixturePreparer { dexpreoptConfig.DisablePreopt = disable }) } + +// FixtureSetEnableUffdGc sets the EnableUffdGc property in the global config. +func FixtureSetEnableUffdGc(value string) android.FixturePreparer { + return FixtureModifyGlobalConfig(func(_ android.PathContext, dexpreoptConfig *GlobalConfig) { + dexpreoptConfig.EnableUffdGc = value + }) +} |