summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-11-14 05:58:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-11-14 05:58:58 +0000
commitceed6be00d486bd068a82342b80997309ed26cd3 (patch)
treeef78eafab922cbe1a4ceded6201f23eab8d11bf9 /java/java_test.go
parent33e7f6a0cadbb09732405dfc33c4fac431fba0ca (diff)
parentae8600b507416192f5134dfc068cd0eea4c4dc9e (diff)
Merge "Pass Config to NewTestContext instead of ctx.Register"
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 6c0a90856..2a27922d1 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -70,9 +70,9 @@ func testConfig(env map[string]string, bp string, fs map[string][]byte) android.
return config
}
-func testContext() *android.TestContext {
+func testContext(config android.Config) *android.TestContext {
- ctx := android.NewTestArchContext()
+ ctx := android.NewTestArchContext(config)
RegisterJavaBuildComponents(ctx)
RegisterAppBuildComponents(ctx)
RegisterAARBuildComponents(ctx)
@@ -115,7 +115,7 @@ func run(t *testing.T, ctx *android.TestContext, config android.Config) {
pathCtx := android.PathContextForTesting(config)
dexpreopt.SetTestGlobalConfig(config, dexpreopt.GlobalConfigForTests(pathCtx))
- ctx.Register(config)
+ ctx.Register()
_, errs := ctx.ParseBlueprintsFiles("Android.bp")
android.FailIfErrored(t, errs)
_, errs = ctx.PrepareBuildActions(config)
@@ -129,12 +129,12 @@ func testJavaError(t *testing.T, pattern string, bp string) (*android.TestContex
func testJavaErrorWithConfig(t *testing.T, pattern string, config android.Config) (*android.TestContext, android.Config) {
t.Helper()
- ctx := testContext()
+ ctx := testContext(config)
pathCtx := android.PathContextForTesting(config)
dexpreopt.SetTestGlobalConfig(config, dexpreopt.GlobalConfigForTests(pathCtx))
- ctx.Register(config)
+ ctx.Register()
_, errs := ctx.ParseBlueprintsFiles("Android.bp")
if len(errs) > 0 {
android.FailIfNoMatchingErrors(t, pattern, errs)
@@ -163,7 +163,7 @@ func testJava(t *testing.T, bp string) (*android.TestContext, android.Config) {
func testJavaWithConfig(t *testing.T, config android.Config) (*android.TestContext, android.Config) {
t.Helper()
- ctx := testContext()
+ ctx := testContext(config)
run(t, ctx, config)
return ctx, config
@@ -1440,7 +1440,7 @@ func TestJavaLibrary(t *testing.T) {
}
`),
})
- ctx := testContext()
+ ctx := testContext(config)
run(t, ctx, config)
}
@@ -1458,7 +1458,7 @@ func TestJavaImport(t *testing.T) {
}
`),
})
- ctx := testContext()
+ ctx := testContext(config)
run(t, ctx, config)
}