summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2024-08-08 15:50:47 -0700
committer Colin Cross <ccross@android.com> 2024-08-09 16:47:45 -0700
commita66b4630f60847c216699831b99aeb905362ccda (patch)
treef67e64ab0206908cbd5155f74b35b43d6271c26b /java/java_test.go
parent788f69722c2fb02bad642d7b5e4bb30a2fa6e86a (diff)
Add PrepareForTestWithBuildFlag
Add a helper function that creates a test fixture preparer that sets a build flag, and use it everywhere that was setting build flags manually. Test: all soong tests Flag: EXEMPT refactor Change-Id: I68d50d68787a30d091f0827e8caa51f5c5a762ef
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 2d4fca240..86bfe9fe4 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -2634,11 +2634,7 @@ func TestMultiplePrebuilts(t *testing.T) {
for _, tc := range testCases {
ctx := android.GroupFixturePreparers(
prepareForJavaTest,
- android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.BuildFlags = map[string]string{
- "RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
- }
- }),
+ android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
// check that rdep gets the correct variation of dep
@@ -2708,11 +2704,7 @@ func TestMultiplePlatformCompatConfigPrebuilts(t *testing.T) {
ctx := android.GroupFixturePreparers(
prepareForJavaTest,
PrepareForTestWithPlatformCompatConfig,
- android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.BuildFlags = map[string]string{
- "RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
- }
- }),
+ android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
mergedGlobalConfig := ctx.SingletonForTests("platform_compat_config_singleton").Output("compat_config/merged_compat_config.xml")