Make TestModule.Output print a list of all outputs on error am: 9cf27db425

am: 799ed60b06

Change-Id: I6c1d89049b517493b8780f05b96b1e2a7e8dec1c
This commit is contained in:
Colin Cross 2017-12-06 04:03:57 +00:00 committed by android-build-merger
commit b1e8caba31

View file

@ -136,6 +136,7 @@ func (m TestingModule) Description(desc string) BuildParams {
}
func (m TestingModule) Output(file string) BuildParams {
var searchedOutputs []string
for _, p := range m.module.BuildParamsForTests() {
outputs := append(WritablePaths(nil), p.Outputs...)
if p.Output != nil {
@ -145,7 +146,9 @@ func (m TestingModule) Output(file string) BuildParams {
if f.String() == file || f.Rel() == file {
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))
}