diff options
author | 2021-09-09 21:34:02 +0100 | |
---|---|---|
committer | 2021-09-09 21:34:02 +0100 | |
commit | 98e0d88aac762fb60aef5b0e60c394524067c8cf (patch) | |
tree | df46e0e6cd78719a3714aa6d6965d4697a0b62a1 /android/testing.go | |
parent | ba839f8070c2705d2ca5c344a445518b3b92afcb (diff) |
Avoid duplicate module names in the error from ModuleForTests.
#codehealth
Test: m nothing
Change-Id: Ia7c3191440452ce04782701bc6ef99251e55af4d
Diffstat (limited to 'android/testing.go')
-rw-r--r-- | android/testing.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/android/testing.go b/android/testing.go index e25e5c5f5..bd2faa291 100644 --- a/android/testing.go +++ b/android/testing.go @@ -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 "))) |