summaryrefslogtreecommitdiff
path: root/apex/apex_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 /apex/apex_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 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go18
1 files changed, 3 insertions, 15 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 852f5fbd7..d6c8a8a73 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -11299,11 +11299,7 @@ func TestBootDexJarsMultipleApexPrebuilts(t *testing.T) {
fs["platform/Test.java"] = nil
}),
- android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.BuildFlags = map[string]string{
- "RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": tc.selectedApexContributions,
- }
- }),
+ android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", tc.selectedApexContributions),
)
ctx := testDexpreoptWithApexes(t, bp, "", preparer, fragment)
checkBootDexJarPath(t, ctx, "framework-foo", tc.expectedBootJar)
@@ -11442,11 +11438,7 @@ func TestInstallationRulesForMultipleApexPrebuilts(t *testing.T) {
android.FixtureMergeMockFs(map[string][]byte{
"system/sepolicy/apex/com.android.foo-file_contexts": nil,
}),
- android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.BuildFlags = map[string]string{
- "RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": tc.selectedApexContributions,
- }
- }),
+ android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", tc.selectedApexContributions),
)
if tc.expectedError != "" {
preparer = preparer.ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(tc.expectedError))
@@ -11562,11 +11554,7 @@ func TestInstallationRulesForMultipleApexPrebuiltsWithoutSource(t *testing.T) {
android.FixtureMergeMockFs(map[string][]byte{
"system/sepolicy/apex/com.android.adservices-file_contexts": nil,
}),
- android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.BuildFlags = map[string]string{
- "RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": tc.selectedApexContributions,
- }
- }),
+ android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", tc.selectedApexContributions),
)
ctx := testApex(t, bp, preparer)