diff options
| author | 2020-06-01 16:32:51 +0000 | |
|---|---|---|
| committer | 2020-06-01 16:32:51 +0000 | |
| commit | 31771f8f14e22b73d9769035b49e9707d7eac07c (patch) | |
| tree | f8ece265ba64672165d4a5281140a6b563830803 | |
| parent | 6200c519e2559501416e7a0b781a1de063ae80e4 (diff) | |
| parent | a91b64d3eeea5598062326c02cdd14dd8d8b704b (diff) | |
Merge "Improved formatting of a module list in a panic message." am: a91b64d3ee
Change-Id: I10a306bd9bd966d10814e8a220aa47e081daeb10
| -rw-r--r-- | android/testing.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/android/testing.go b/android/testing.go index 90989ef53..696efb6f8 100644 --- a/android/testing.go +++ b/android/testing.go @@ -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} |