Split ArchMutatorContext out of BaseMutatorContext
Split the context methods that are useful on anything visiting a module that has arch variants into a separate ArchMutatorContext for reuse by TranstitionMutators. Bug: 319288033 Test: builds Change-Id: Ifdc21983c6c79f22965a49f169812a8cc3ad975b
This commit is contained in:
@@ -35,6 +35,7 @@ bootstrap_go_package {
|
|||||||
"api_levels.go",
|
"api_levels.go",
|
||||||
"arch.go",
|
"arch.go",
|
||||||
"arch_list.go",
|
"arch_list.go",
|
||||||
|
"arch_module_context.go",
|
||||||
"base_module_context.go",
|
"base_module_context.go",
|
||||||
"buildinfo_prop.go",
|
"buildinfo_prop.go",
|
||||||
"config.go",
|
"config.go",
|
||||||
|
83
android/arch_module_context.go
Normal file
83
android/arch_module_context.go
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
// Copyright 2024 Google Inc. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package android
|
||||||
|
|
||||||
|
// ArchModuleContext can be embedded in other contexts to provide information about the module set by
|
||||||
|
// the archMutator.
|
||||||
|
type ArchModuleContext interface {
|
||||||
|
Target() Target
|
||||||
|
TargetPrimary() bool
|
||||||
|
|
||||||
|
// The additional arch specific targets (e.g. 32/64 bit) that this module variant is
|
||||||
|
// responsible for creating.
|
||||||
|
MultiTargets() []Target
|
||||||
|
Arch() Arch
|
||||||
|
Os() OsType
|
||||||
|
Host() bool
|
||||||
|
Device() bool
|
||||||
|
Darwin() bool
|
||||||
|
Windows() bool
|
||||||
|
PrimaryArch() bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type archModuleContext struct {
|
||||||
|
// TODO: these should eventually go through a (possibly cached) provider like any other configuration instead
|
||||||
|
// of being special cased.
|
||||||
|
os OsType
|
||||||
|
target Target
|
||||||
|
targetPrimary bool
|
||||||
|
multiTargets []Target
|
||||||
|
primaryArch bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) Target() Target {
|
||||||
|
return a.target
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) TargetPrimary() bool {
|
||||||
|
return a.targetPrimary
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) MultiTargets() []Target {
|
||||||
|
return a.multiTargets
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) Arch() Arch {
|
||||||
|
return a.target.Arch
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) Os() OsType {
|
||||||
|
return a.os
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) Host() bool {
|
||||||
|
return a.os.Class == Host
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) Device() bool {
|
||||||
|
return a.os.Class == Device
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) Darwin() bool {
|
||||||
|
return a.os == Darwin
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *archModuleContext) Windows() bool {
|
||||||
|
return a.os == Windows
|
||||||
|
}
|
||||||
|
|
||||||
|
func (b *archModuleContext) PrimaryArch() bool {
|
||||||
|
return b.primaryArch
|
||||||
|
}
|
@@ -26,6 +26,7 @@ import (
|
|||||||
// instead of a blueprint.Module, plus some extra methods that return Android-specific information
|
// instead of a blueprint.Module, plus some extra methods that return Android-specific information
|
||||||
// about the current module.
|
// about the current module.
|
||||||
type BaseModuleContext interface {
|
type BaseModuleContext interface {
|
||||||
|
ArchModuleContext
|
||||||
EarlyModuleContext
|
EarlyModuleContext
|
||||||
|
|
||||||
blueprintBaseModuleContext() blueprint.BaseModuleContext
|
blueprintBaseModuleContext() blueprint.BaseModuleContext
|
||||||
@@ -204,29 +205,12 @@ type BaseModuleContext interface {
|
|||||||
// getMissingDependencies returns the list of missing dependencies.
|
// getMissingDependencies returns the list of missing dependencies.
|
||||||
// Calling this function prevents adding new dependencies.
|
// Calling this function prevents adding new dependencies.
|
||||||
getMissingDependencies() []string
|
getMissingDependencies() []string
|
||||||
|
|
||||||
Target() Target
|
|
||||||
TargetPrimary() bool
|
|
||||||
|
|
||||||
// The additional arch specific targets (e.g. 32/64 bit) that this module variant is
|
|
||||||
// responsible for creating.
|
|
||||||
MultiTargets() []Target
|
|
||||||
Arch() Arch
|
|
||||||
Os() OsType
|
|
||||||
Host() bool
|
|
||||||
Device() bool
|
|
||||||
Darwin() bool
|
|
||||||
Windows() bool
|
|
||||||
PrimaryArch() bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type baseModuleContext struct {
|
type baseModuleContext struct {
|
||||||
bp blueprint.BaseModuleContext
|
bp blueprint.BaseModuleContext
|
||||||
earlyModuleContext
|
earlyModuleContext
|
||||||
os OsType
|
archModuleContext
|
||||||
target Target
|
|
||||||
multiTargets []Target
|
|
||||||
targetPrimary bool
|
|
||||||
|
|
||||||
walkPath []Module
|
walkPath []Module
|
||||||
tagPath []blueprint.DependencyTag
|
tagPath []blueprint.DependencyTag
|
||||||
@@ -561,46 +545,3 @@ func (b *baseModuleContext) GetPathString(skipFirst bool) string {
|
|||||||
}
|
}
|
||||||
return sb.String()
|
return sb.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *baseModuleContext) Target() Target {
|
|
||||||
return b.target
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) TargetPrimary() bool {
|
|
||||||
return b.targetPrimary
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) MultiTargets() []Target {
|
|
||||||
return b.multiTargets
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) Arch() Arch {
|
|
||||||
return b.target.Arch
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) Os() OsType {
|
|
||||||
return b.os
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) Host() bool {
|
|
||||||
return b.os.Class == Host
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) Device() bool {
|
|
||||||
return b.os.Class == Device
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) Darwin() bool {
|
|
||||||
return b.os == Darwin
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) Windows() bool {
|
|
||||||
return b.os == Windows
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *baseModuleContext) PrimaryArch() bool {
|
|
||||||
if len(b.config.Targets[b.target.Os]) <= 1 {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return b.target.Arch.ArchType == b.config.Targets[b.target.Os][0].Arch.ArchType
|
|
||||||
}
|
|
||||||
|
@@ -1622,12 +1622,29 @@ func (m *ModuleBase) earlyModuleContextFactory(ctx blueprint.EarlyModuleContext)
|
|||||||
func (m *ModuleBase) baseModuleContextFactory(ctx blueprint.BaseModuleContext) baseModuleContext {
|
func (m *ModuleBase) baseModuleContextFactory(ctx blueprint.BaseModuleContext) baseModuleContext {
|
||||||
return baseModuleContext{
|
return baseModuleContext{
|
||||||
bp: ctx,
|
bp: ctx,
|
||||||
|
archModuleContext: m.archModuleContextFactory(ctx),
|
||||||
earlyModuleContext: m.earlyModuleContextFactory(ctx),
|
earlyModuleContext: m.earlyModuleContextFactory(ctx),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ModuleBase) archModuleContextFactory(ctx blueprint.EarlyModuleContext) archModuleContext {
|
||||||
|
config := ctx.Config().(Config)
|
||||||
|
target := m.Target()
|
||||||
|
primaryArch := false
|
||||||
|
if len(config.Targets[target.Os]) <= 1 {
|
||||||
|
primaryArch = true
|
||||||
|
} else {
|
||||||
|
primaryArch = target.Arch.ArchType == config.Targets[target.Os][0].Arch.ArchType
|
||||||
|
}
|
||||||
|
|
||||||
|
return archModuleContext{
|
||||||
os: m.commonProperties.CompileOS,
|
os: m.commonProperties.CompileOS,
|
||||||
target: m.commonProperties.CompileTarget,
|
target: m.commonProperties.CompileTarget,
|
||||||
targetPrimary: m.commonProperties.CompilePrimary,
|
targetPrimary: m.commonProperties.CompilePrimary,
|
||||||
multiTargets: m.commonProperties.CompileMultiTargets,
|
multiTargets: m.commonProperties.CompileMultiTargets,
|
||||||
|
primaryArch: primaryArch,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) {
|
func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) {
|
||||||
|
@@ -268,10 +268,12 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "host binary",
|
name: "host binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: hostTarget.Os,
|
os: hostTarget.Os,
|
||||||
target: hostTarget,
|
target: hostTarget,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
in: []string{"bin", "my_test"},
|
in: []string{"bin", "my_test"},
|
||||||
out: "host/linux-x86/bin/my_test",
|
out: "host/linux-x86/bin/my_test",
|
||||||
partitionDir: "host/linux-x86",
|
partitionDir: "host/linux-x86",
|
||||||
@@ -281,10 +283,12 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "system binary",
|
name: "system binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
in: []string{"bin", "my_test"},
|
in: []string{"bin", "my_test"},
|
||||||
out: "target/product/test_device/system/bin/my_test",
|
out: "target/product/test_device/system/bin/my_test",
|
||||||
partitionDir: "target/product/test_device/system",
|
partitionDir: "target/product/test_device/system",
|
||||||
@@ -293,8 +297,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "vendor binary",
|
name: "vendor binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: socSpecificModule,
|
kind: socSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -308,8 +314,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "odm binary",
|
name: "odm binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: deviceSpecificModule,
|
kind: deviceSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -323,8 +331,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "product binary",
|
name: "product binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: productSpecificModule,
|
kind: productSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -338,8 +348,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "system_ext binary",
|
name: "system_ext binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: systemExtSpecificModule,
|
kind: systemExtSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -353,9 +365,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "root binary",
|
name: "root binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inRoot: true,
|
inRoot: true,
|
||||||
},
|
},
|
||||||
in: []string{"my_test"},
|
in: []string{"my_test"},
|
||||||
@@ -366,9 +380,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "recovery binary",
|
name: "recovery binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inRecovery: true,
|
inRecovery: true,
|
||||||
},
|
},
|
||||||
in: []string{"bin/my_test"},
|
in: []string{"bin/my_test"},
|
||||||
@@ -379,9 +395,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "recovery root binary",
|
name: "recovery root binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inRecovery: true,
|
inRecovery: true,
|
||||||
inRoot: true,
|
inRoot: true,
|
||||||
},
|
},
|
||||||
@@ -394,9 +412,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "ramdisk binary",
|
name: "ramdisk binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inRamdisk: true,
|
inRamdisk: true,
|
||||||
},
|
},
|
||||||
in: []string{"my_test"},
|
in: []string{"my_test"},
|
||||||
@@ -407,9 +427,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "ramdisk root binary",
|
name: "ramdisk root binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inRamdisk: true,
|
inRamdisk: true,
|
||||||
inRoot: true,
|
inRoot: true,
|
||||||
},
|
},
|
||||||
@@ -421,9 +443,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "vendor_ramdisk binary",
|
name: "vendor_ramdisk binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inVendorRamdisk: true,
|
inVendorRamdisk: true,
|
||||||
},
|
},
|
||||||
in: []string{"my_test"},
|
in: []string{"my_test"},
|
||||||
@@ -434,9 +458,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "vendor_ramdisk root binary",
|
name: "vendor_ramdisk root binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inVendorRamdisk: true,
|
inVendorRamdisk: true,
|
||||||
inRoot: true,
|
inRoot: true,
|
||||||
},
|
},
|
||||||
@@ -448,9 +474,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "debug_ramdisk binary",
|
name: "debug_ramdisk binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inDebugRamdisk: true,
|
inDebugRamdisk: true,
|
||||||
},
|
},
|
||||||
in: []string{"my_test"},
|
in: []string{"my_test"},
|
||||||
@@ -461,9 +489,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "system native test binary",
|
name: "system native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inData: true,
|
inData: true,
|
||||||
},
|
},
|
||||||
in: []string{"nativetest", "my_test"},
|
in: []string{"nativetest", "my_test"},
|
||||||
@@ -474,8 +504,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "vendor native test binary",
|
name: "vendor native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: socSpecificModule,
|
kind: socSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -490,8 +522,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "odm native test binary",
|
name: "odm native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: deviceSpecificModule,
|
kind: deviceSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -506,8 +540,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "product native test binary",
|
name: "product native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: productSpecificModule,
|
kind: productSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -523,8 +559,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "system_ext native test binary",
|
name: "system_ext native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: systemExtSpecificModule,
|
kind: systemExtSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -540,9 +578,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized system binary",
|
name: "sanitized system binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inSanitizerDir: true,
|
inSanitizerDir: true,
|
||||||
},
|
},
|
||||||
in: []string{"bin", "my_test"},
|
in: []string{"bin", "my_test"},
|
||||||
@@ -553,8 +593,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized vendor binary",
|
name: "sanitized vendor binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: socSpecificModule,
|
kind: socSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -569,8 +611,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized odm binary",
|
name: "sanitized odm binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: deviceSpecificModule,
|
kind: deviceSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -585,8 +629,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized product binary",
|
name: "sanitized product binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: productSpecificModule,
|
kind: productSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -602,8 +648,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized system_ext binary",
|
name: "sanitized system_ext binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: systemExtSpecificModule,
|
kind: systemExtSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -619,9 +667,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized system native test binary",
|
name: "sanitized system native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inData: true,
|
inData: true,
|
||||||
inSanitizerDir: true,
|
inSanitizerDir: true,
|
||||||
},
|
},
|
||||||
@@ -633,8 +683,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized vendor native test binary",
|
name: "sanitized vendor native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: socSpecificModule,
|
kind: socSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -650,8 +702,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized odm native test binary",
|
name: "sanitized odm native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: deviceSpecificModule,
|
kind: deviceSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -667,8 +721,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized product native test binary",
|
name: "sanitized product native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: productSpecificModule,
|
kind: productSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -684,8 +740,10 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "sanitized system_ext native test binary",
|
name: "sanitized system_ext native test binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
|
},
|
||||||
earlyModuleContext: earlyModuleContext{
|
earlyModuleContext: earlyModuleContext{
|
||||||
kind: systemExtSpecificModule,
|
kind: systemExtSpecificModule,
|
||||||
},
|
},
|
||||||
@@ -700,9 +758,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "device testcases",
|
name: "device testcases",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inTestcases: true,
|
inTestcases: true,
|
||||||
},
|
},
|
||||||
in: []string{"my_test", "my_test_bin"},
|
in: []string{"my_test", "my_test_bin"},
|
||||||
@@ -712,9 +772,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "host testcases",
|
name: "host testcases",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: hostTarget.Os,
|
os: hostTarget.Os,
|
||||||
target: hostTarget,
|
target: hostTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inTestcases: true,
|
inTestcases: true,
|
||||||
},
|
},
|
||||||
in: []string{"my_test", "my_test_bin"},
|
in: []string{"my_test", "my_test_bin"},
|
||||||
@@ -724,9 +786,11 @@ func TestPathForModuleInstall(t *testing.T) {
|
|||||||
name: "forced host testcases",
|
name: "forced host testcases",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inTestcases: true,
|
inTestcases: true,
|
||||||
forceOS: &Linux,
|
forceOS: &Linux,
|
||||||
forceArch: &X86,
|
forceArch: &X86,
|
||||||
@@ -771,9 +835,11 @@ func TestPathForModuleInstallRecoveryAsBoot(t *testing.T) {
|
|||||||
name: "ramdisk binary",
|
name: "ramdisk binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inRamdisk: true,
|
inRamdisk: true,
|
||||||
inRoot: true,
|
inRoot: true,
|
||||||
},
|
},
|
||||||
@@ -786,9 +852,11 @@ func TestPathForModuleInstallRecoveryAsBoot(t *testing.T) {
|
|||||||
name: "vendor_ramdisk binary",
|
name: "vendor_ramdisk binary",
|
||||||
ctx: &testModuleInstallPathContext{
|
ctx: &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
inVendorRamdisk: true,
|
inVendorRamdisk: true,
|
||||||
inRoot: true,
|
inRoot: true,
|
||||||
},
|
},
|
||||||
@@ -821,9 +889,11 @@ func TestBaseDirForInstallPath(t *testing.T) {
|
|||||||
|
|
||||||
ctx := &testModuleInstallPathContext{
|
ctx := &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
ctx.baseModuleContext.config = testConfig
|
ctx.baseModuleContext.config = testConfig
|
||||||
|
|
||||||
@@ -1491,9 +1561,11 @@ func TestPathRelativeToTop(t *testing.T) {
|
|||||||
|
|
||||||
ctx := &testModuleInstallPathContext{
|
ctx := &testModuleInstallPathContext{
|
||||||
baseModuleContext: baseModuleContext{
|
baseModuleContext: baseModuleContext{
|
||||||
|
archModuleContext: archModuleContext{
|
||||||
os: deviceTarget.Os,
|
os: deviceTarget.Os,
|
||||||
target: deviceTarget,
|
target: deviceTarget,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
ctx.baseModuleContext.config = testConfig
|
ctx.baseModuleContext.config = testConfig
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user