Merge "Add support of test data to python_host_test"

This commit is contained in:
Treehugger Robot
2020-09-29 21:56:19 +00:00
committed by Gerrit Code Review
5 changed files with 39 additions and 21 deletions

View File

@@ -639,3 +639,21 @@ func shouldSkipAndroidMkProcessing(module *ModuleBase) bool {
// Make does not understand LinuxBionic
module.Os() == LinuxBionic
}
func AndroidMkDataPaths(data []DataPath) []string {
var testFiles []string
for _, d := range data {
rel := d.SrcPath.Rel()
path := d.SrcPath.String()
if !strings.HasSuffix(path, rel) {
panic(fmt.Errorf("path %q does not end with %q", path, rel))
}
path = strings.TrimSuffix(path, rel)
testFileString := path + ":" + rel
if len(d.RelativeInstallPath) > 0 {
testFileString += ":" + d.RelativeInstallPath
}
testFiles = append(testFiles, testFileString)
}
return testFiles
}