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
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index 9d7dddd..7c12c68 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -52,7 +52,7 @@
}
func newContext(srcDir string, configuration android.Config) *android.Context {
- ctx := android.NewContext()
+ ctx := android.NewContext(configuration)
ctx.Register()
if !shouldPrepareBuildActions() {
configuration.SetStopBefore(bootstrap.StopBeforePrepareBuildActions)