Fix install location for vendor tests

These should be install in /data/nativetest* with the rest of the tests,
but had been moved to /vendor/nativetest* accidentally. Add some tests
so that this doesn't happen again.

Bug: 63393698
Test: m -j blueprint_tools
Test: compare out/soong/Android-aosp_arm64.mk
Test: compare out/soong/build.ninja
Change-Id: Id3b08a7e3908955df18a043a02ea576dc88086c3
This commit is contained in:
Dan Willemsen
2017-07-06 16:59:48 -07:00
parent 4c35af09ea
commit 00269f23ee
3 changed files with 188 additions and 13 deletions

View File

@@ -39,6 +39,17 @@ type PathGlobContext interface {
var _ PathContext = blueprint.SingletonContext(nil)
var _ PathContext = blueprint.ModuleContext(nil)
type ModuleInstallPathContext interface {
PathContext
androidBaseContext
InstallInData() bool
InstallInSanitizerDir() bool
}
var _ ModuleInstallPathContext = ModuleContext(nil)
// errorfContext is the interface containing the Errorf method matching the
// Errorf method in blueprint.SingletonContext.
type errorfContext interface {
@@ -669,14 +680,14 @@ func PathForModuleRes(ctx ModuleContext, pathComponents ...string) ModuleResPath
// PathForModuleInstall returns a Path representing the install path for the
// module appended with paths...
func PathForModuleInstall(ctx ModuleContext, pathComponents ...string) OutputPath {
func PathForModuleInstall(ctx ModuleInstallPathContext, pathComponents ...string) OutputPath {
var outPaths []string
if ctx.Device() {
var partition string
if ctx.Vendor() {
partition = ctx.DeviceConfig().VendorPath()
} else if ctx.InstallInData() {
if ctx.InstallInData() {
partition = "data"
} else if ctx.Vendor() {
partition = ctx.DeviceConfig().VendorPath()
} else {
partition = "system"
}