Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03f327c8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Avoid duplicate module names in the error from ModuleForTests." am: eee562f9

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1823277

Change-Id: I0c4865071f4aba40f63ab34e0f9676be1063e634
parents 7d927b62 eee562f9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -509,12 +509,11 @@ func (ctx *TestContext) ModuleForTests(name, variant string) TestingModule {
				allVariants = append(allVariants, ctx.ModuleSubDir(m))
			}
		})
		sort.Strings(allModuleNames)
		sort.Strings(allVariants)

		if len(allVariants) == 0 {
			panic(fmt.Errorf("failed to find module %q. All modules:\n  %s",
				name, strings.Join(allModuleNames, "\n  ")))
				name, strings.Join(SortedUniqueStrings(allModuleNames), "\n  ")))
		} else {
			panic(fmt.Errorf("failed to find module %q variant %q. All variants:\n  %s",
				name, variant, strings.Join(allVariants, "\n  ")))