Fix android_test install path.
Test: m nothing + diff soong mk and ninja files.
Bug: 140795853
Change-Id: I3667eac951dea7e447cf73219ff89199fca9ed63
diff --git a/android/module.go b/android/module.go
index 8076a99..a1a01a5 100644
--- a/android/module.go
+++ b/android/module.go
@@ -154,6 +154,7 @@
CheckbuildFile(srcPath Path)
InstallInData() bool
+ InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRecovery() bool
InstallBypassMake() bool
@@ -192,6 +193,7 @@
Enabled() bool
Target() Target
InstallInData() bool
+ InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRecovery() bool
InstallBypassMake() bool
@@ -832,6 +834,10 @@
return false
}
+func (m *ModuleBase) InstallInTestcases() bool {
+ return false
+}
+
func (m *ModuleBase) InstallInSanitizerDir() bool {
return false
}
@@ -1504,6 +1510,10 @@
return m.module.InstallInData()
}
+func (m *moduleContext) InstallInTestcases() bool {
+ return m.module.InstallInTestcases()
+}
+
func (m *moduleContext) InstallInSanitizerDir() bool {
return m.module.InstallInSanitizerDir()
}
diff --git a/android/paths.go b/android/paths.go
index 0d64a61..8bd2c61 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -44,6 +44,7 @@
BaseModuleContext
InstallInData() bool
+ InstallInTestcases() bool
InstallInSanitizerDir() bool
InstallInRecovery() bool
InstallBypassMake() bool
@@ -1155,6 +1156,8 @@
var partition string
if ctx.InstallInData() {
partition = "data"
+ } else if ctx.InstallInTestcases() {
+ partition = "testcases"
} else if ctx.InstallInRecovery() {
// the layout of recovery partion is the same as that of system partition
partition = "recovery/root/system"
diff --git a/android/paths_test.go b/android/paths_test.go
index f2996bf..b66eb1e 100644
--- a/android/paths_test.go
+++ b/android/paths_test.go
@@ -201,6 +201,7 @@
baseModuleContext
inData bool
+ inTestcases bool
inSanitizerDir bool
inRecovery bool
}
@@ -219,6 +220,10 @@
return m.inData
}
+func (m moduleInstallPathContextImpl) InstallInTestcases() bool {
+ return m.inTestcases
+}
+
func (m moduleInstallPathContextImpl) InstallInSanitizerDir() bool {
return m.inSanitizerDir
}