From 98be1bb00f0fb10e195f26fd2a19952d701a1950 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 13 Dec 2019 20:41:13 -0800 Subject: Move filesystem into Config The filesystem object was available through ModuleContext.Fs(), but gives too much access to the filesystem without enforicing correct dependencies. In order to support sandboxing the soong_build process move the filesystem into the Config. The next change will make it private. Bug: 146437378 Test: all Soong tests Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813 --- android/namespace_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'android/namespace_test.go') diff --git a/android/namespace_test.go b/android/namespace_test.go index 90058e3f5..66c0d895a 100644 --- a/android/namespace_test.go +++ b/android/namespace_test.go @@ -633,10 +633,9 @@ func mockFiles(bps map[string]string) (files map[string][]byte) { } func setupTestFromFiles(bps map[string][]byte) (ctx *TestContext, errs []error) { - config := TestConfig(buildDir, nil) + config := TestConfig(buildDir, nil, "", bps) ctx = NewTestContext() - ctx.MockFileSystem(bps) ctx.RegisterModuleType("test_module", newTestModule) ctx.RegisterModuleType("soong_namespace", NamespaceFactory) ctx.Context.RegisterModuleType("blueprint_test_module", newBlueprintTestModule) @@ -644,7 +643,7 @@ func setupTestFromFiles(bps map[string][]byte) (ctx *TestContext, errs []error) ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) { ctx.BottomUp("rename", renameMutator) }) - ctx.Register() + ctx.Register(config) _, errs = ctx.ParseBlueprintsFiles("Android.bp") if len(errs) > 0 { -- cgit v1.2.3-59-g8ed1b