Merge "Improved formatting of a module list in a panic message." am: a91b64d3ee
am: 31771f8f14
Change-Id: I5a7fdb194011300b86a42f8dd8b8dfcf95e6d3d3
This commit is contained in:
commit
a034aecb73
1 changed files with 4 additions and 2 deletions
|
@ -18,6 +18,7 @@ import (
|
|||
"fmt"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -122,9 +123,10 @@ func (ctx *TestContext) ModuleForTests(name, variant string) TestingModule {
|
|||
ctx.VisitAllModules(func(m blueprint.Module) {
|
||||
allModuleNames = append(allModuleNames, m.(Module).Name()+"("+ctx.ModuleSubDir(m)+")")
|
||||
})
|
||||
sort.Strings(allModuleNames)
|
||||
|
||||
panic(fmt.Errorf("failed to find module %q variant %q."+
|
||||
"\nall modules: %v", name, variant, allModuleNames))
|
||||
panic(fmt.Errorf("failed to find module %q variant %q. All modules:\n %s",
|
||||
name, variant, strings.Join(allModuleNames, "\n ")))
|
||||
}
|
||||
|
||||
return TestingModule{module}
|
||||
|
|
Loading…
Reference in a new issue