summaryrefslogtreecommitdiff
path: root/android/testing.go
diff options
context:
space:
mode:
author mrziwang <mrziwang@google.com> 2024-06-18 12:43:41 -0700
committer mrziwang <mrziwang@google.com> 2024-06-25 15:37:09 -0700
commitabdb293492018ba8fe29a94817e089fc8174fa56 (patch)
tree62ec584f5ccd780c406e84478a54463a5166fabc /android/testing.go
parent94a6824c99dc001532fa55203462cf4fecb9f9b2 (diff)
Update outputFilesForModuleFromProvider
This CL includes following changes: 1. Added the ability to differentiate the cases that module never sets OutputFilesProvider and that module sets the provider with a nil value. 2. Updated GenerateTaggedDistFiles to use outputFilesForModuleFromProvider. 3. Updated on cc module to use OutputFilesProvider. Test: CI Bug: 339477385 Change-Id: Ib5663a947315f6a90a81b7f073cf8dd22fbb1e05
Diffstat (limited to 'android/testing.go')
-rw-r--r--android/testing.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/android/testing.go b/android/testing.go
index 8dd467dce..18fd3b31c 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -1025,9 +1025,12 @@ func (m TestingModule) VariablesForTestsRelativeToTop() map[string]string {
// otherwise returns the result of calling Paths.RelativeToTop
// on the returned Paths.
func (m TestingModule) OutputFiles(t *testing.T, tag string) Paths {
- // TODO: add non-empty-string tag case and remove OutputFileProducer part
- if tag == "" && m.module.base().outputFiles.DefaultOutputFiles != nil {
- return m.module.base().outputFiles.DefaultOutputFiles.RelativeToTop()
+ // 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)