summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2020-01-10 20:32:59 +0000
committerMartin Stjernholm <mast@google.com>2020-02-13 17:21:13 +0000
commit75a48d8ae23c017dadc7ac025b45f5a1aebfbe4c (patch)
tree078c89c9f86ffe3f2bf9cc0f15242644971408c4 /java/java_test.go
parent394b9b379a9f84d26089b44a4eb130789422435f (diff)
Reland: Separate dexpreopt.GlobalSoongConfig to allow independent
caching of it. Introduce a Once cache for GlobalSoongConfig to allow it to get binary tool paths from ordinary module dependencies (coming in a future CL) that are then reused in singletons. This relands https://r.android.com/1205729. Bug: 145934348 Test: m Change-Id: I039d6e204bee5ddc16d8e2d85057fbec20e326fe
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 17921ca44..9c5680b0c 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -57,7 +57,13 @@ func TestMain(m *testing.M) {
}
func testConfig(env map[string]string, bp string, fs map[string][]byte) android.Config {
- return TestConfig(buildDir, env, bp, fs)
+ 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
}
func testContext() *android.TestContext {