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
This commit is contained in:
@@ -84,14 +84,12 @@ func TestPackage(t *testing.T) {
|
||||
func testPackage(fs map[string][]byte) (*TestContext, []error) {
|
||||
|
||||
// Create a new config per test as visibility information is stored in the config.
|
||||
config := TestArchConfig(buildDir, nil)
|
||||
config := TestArchConfig(buildDir, nil, "", fs)
|
||||
|
||||
ctx := NewTestArchContext()
|
||||
ctx.RegisterModuleType("package", PackageFactory)
|
||||
ctx.PreArchMutators(RegisterPackageRenamer)
|
||||
ctx.Register()
|
||||
|
||||
ctx.MockFileSystem(fs)
|
||||
ctx.Register(config)
|
||||
|
||||
_, errs := ctx.ParseBlueprintsFiles(".")
|
||||
if len(errs) > 0 {
|
||||
|
Reference in New Issue
Block a user