From a66b4630f60847c216699831b99aeb905362ccda Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 8 Aug 2024 15:50:47 -0700 Subject: 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 --- sdk/sdk_test.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'sdk/sdk_test.go') 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", "", -- cgit v1.2.3-59-g8ed1b