From 9f04524673e84f9be7f06e2e13266d8fda2f151f Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 21 Jan 2021 15:05:11 +0000 Subject: Allow createGlobalSoongConfig() to be used from tests Previously, the createGlobalSoongConfig() function was explicitly prevented from being used in tests because it would fail. However, it turns out that is no longer the case and it does now work. That allows the following changes to be made: * Tests no longer need to use GlobalSoongConfigForTests() to prepopulate the cache. * GlobalSoongConfigForTests() is only needed in the dexpreopt package. Bug: 177892522 Test: m nothing Change-Id: Ifcbb1a44254c5d2d10c1d02ab23227488d1d1ed1 --- java/java_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index 2a23f371e..7b8984810 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -61,13 +61,7 @@ func TestMain(m *testing.M) { func testConfig(env map[string]string, bp string, fs map[string][]byte) android.Config { bp += dexpreopt.BpToolModulesForTest() - config := TestConfig(buildDir, env, bp, fs) - - // Set up the global Once cache used for dexpreopt.GlobalSoongConfig, so that - // it doesn't create a real one, which would fail. - _ = dexpreopt.GlobalSoongConfigForTests(config) - - return config + return TestConfig(buildDir, env, bp, fs) } func testContext(config android.Config) *android.TestContext { -- cgit v1.2.3-59-g8ed1b