summaryrefslogtreecommitdiff
path: root/sdk/sdk_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 /sdk/sdk_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 'sdk/sdk_test.go')
-rw-r--r--sdk/sdk_test.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go
index 4894210d4..057b370d3 100644
--- a/sdk/sdk_test.go
+++ b/sdk/sdk_test.go
@@ -457,11 +457,7 @@ java_import {
android.FixtureMergeEnv(map[string]string{
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
}),
- android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.BuildFlags = map[string]string{
- "RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
- }
- }),
+ android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
).RunTest(t)
CheckSnapshot(t, result, "mysdk", "",
@@ -573,11 +569,9 @@ java_sdk_library_import {
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
}),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
- variables.BuildFlags = map[string]string{
- "RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
- }
variables.Platform_version_active_codenames = []string{"UpsideDownCake", "Tiramisu", "S-V2"}
}),
+ android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
).RunTest(t)
CheckSnapshot(t, result, "mysdk", "",