summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 8d3efcb81..817955cad 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -24,6 +24,7 @@ import (
"android/soong/android"
"android/soong/cc"
+ "android/soong/dexpreopt"
"android/soong/genrule"
)
@@ -101,8 +102,6 @@ func testContext(config android.Config, bp string,
ctx.BottomUp("begin", cc.BeginMutator).Parallel()
})
- ctx.Register()
-
bp += GatherRequiredDepsForTest()
mockFS := map[string][]byte{
@@ -187,6 +186,11 @@ func testContext(config android.Config, bp string,
func run(t *testing.T, ctx *android.TestContext, config android.Config) {
t.Helper()
+
+ pathCtx := android.PathContextForTesting(config, nil)
+ setDexpreoptTestGlobalConfig(config, dexpreopt.GlobalConfigForTests(pathCtx))
+
+ ctx.Register()
_, errs := ctx.ParseFileList(".", []string{"Android.bp", "prebuilts/sdk/Android.bp"})
android.FailIfErrored(t, errs)
_, errs = ctx.PrepareBuildActions(config)