summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/android/testing.go b/android/testing.go
index 6518f4a53..18fd3b31c 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -224,6 +224,10 @@ func (ctx *TestContext) OtherModuleProviderAdaptor() OtherModuleProviderContext
})
}
+func (ctx *TestContext) OtherModulePropertyErrorf(module Module, property string, fmt_ string, args ...interface{}) {
+ panic(fmt.Sprintf(fmt_, args...))
+}
+
// registeredComponentOrder defines the order in which a sortableComponent type is registered at
// runtime and provides support for reordering the components registered for a test in the same
// way.
@@ -1014,10 +1018,21 @@ func (m TestingModule) VariablesForTestsRelativeToTop() map[string]string {
return normalizeStringMapRelativeToTop(m.config, m.module.VariablesForTests())
}
-// OutputFiles calls OutputFileProducer.OutputFiles on the encapsulated module, exits the test
-// immediately if there is an error and otherwise returns the result of calling Paths.RelativeToTop
+// OutputFiles first checks if module base outputFiles property has any output
+// files can be used to return.
+// If not, it calls OutputFileProducer.OutputFiles on the
+// encapsulated module, exits the test immediately if there is an error and
+// otherwise returns the result of calling Paths.RelativeToTop
// on the returned Paths.
func (m TestingModule) OutputFiles(t *testing.T, tag string) Paths {
+ // TODO: remove OutputFileProducer part
+ outputFiles := m.Module().base().outputFiles
+ if tag == "" && outputFiles.DefaultOutputFiles != nil {
+ return outputFiles.DefaultOutputFiles.RelativeToTop()
+ } else if taggedOutputFiles, hasTag := outputFiles.TaggedOutputFiles[tag]; hasTag {
+ return taggedOutputFiles
+ }
+
producer, ok := m.module.(OutputFileProducer)
if !ok {
t.Fatalf("%q must implement OutputFileProducer\n", m.module.Name())