Make TestModule.Output print a list of all outputs on error

am: 9cf27db425

Change-Id: Id3e6b3e4b2faee411753d4e34ce59a3cee2651ac
This commit is contained in:
Colin Cross 2017-12-06 04:01:26 +00:00 committed by android-build-merger
commit 799ed60b06

View file

@ -136,6 +136,7 @@ func (m TestingModule) Description(desc string) BuildParams {
} }
func (m TestingModule) Output(file string) BuildParams { func (m TestingModule) Output(file string) BuildParams {
var searchedOutputs []string
for _, p := range m.module.BuildParamsForTests() { for _, p := range m.module.BuildParamsForTests() {
outputs := append(WritablePaths(nil), p.Outputs...) outputs := append(WritablePaths(nil), p.Outputs...)
if p.Output != nil { if p.Output != nil {
@ -145,7 +146,9 @@ func (m TestingModule) Output(file string) BuildParams {
if f.String() == file || f.Rel() == file { if f.String() == file || f.Rel() == file {
return p return p
} }
searchedOutputs = append(searchedOutputs, f.Rel())
} }
} }
panic(fmt.Errorf("couldn't find output %q", file)) panic(fmt.Errorf("couldn't find output %q.\nall outputs: %v",
file, searchedOutputs))
} }