Pass Config to NewTestContext instead of ctx.Register

Prepare for using Config when adding singletons by passing
Config to NewTestContext and NewContext instead of to ctx.Register.
This will enable a followup change to store SingletonMakeVarsProviders
registered on the Context in the Config, which is necessary to run
multiple tests in parallel without data races.

Test: all soong tests
Change-Id: Id229629a4e42ff4487d317241673837726c075fc
This commit is contained in:
Colin Cross
2020-10-29 17:09:13 -07:00
parent 45e0c95f85
commit ae8600b507
45 changed files with 209 additions and 208 deletions

View File

@@ -356,7 +356,7 @@ func TestClasspath(t *testing.T) {
config.TestProductVariables.Unbundled_build = proptools.BoolPtr(true)
config.TestProductVariables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
}
ctx := testContext()
ctx := testContext(config)
run(t, ctx, config)
checkClasspath(t, ctx, true /* isJava8 */)
@@ -377,7 +377,7 @@ func TestClasspath(t *testing.T) {
config.TestProductVariables.Unbundled_build = proptools.BoolPtr(true)
config.TestProductVariables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
}
ctx := testContext()
ctx := testContext(config)
run(t, ctx, config)
checkClasspath(t, ctx, false /* isJava8 */)
@@ -401,7 +401,7 @@ func TestClasspath(t *testing.T) {
config.TestProductVariables.Unbundled_build = proptools.BoolPtr(true)
config.TestProductVariables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
}
ctx := testContext()
ctx := testContext(config)
run(t, ctx, config)
checkClasspath(t, ctx, true /* isJava8 */)
@@ -417,7 +417,7 @@ func TestClasspath(t *testing.T) {
config.TestProductVariables.Unbundled_build = proptools.BoolPtr(true)
config.TestProductVariables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
}
ctx := testContext()
ctx := testContext(config)
run(t, ctx, config)
checkClasspath(t, ctx, false /* isJava8 */)