From 3f97ea2ed979a84b3c24db2a91af3cb05b751b3e Mon Sep 17 00:00:00 2001 From: nelsonli Date: Mon, 21 Nov 2022 21:37:56 +0800 Subject: [PATCH] Set the test suite for Robolectric tests Mark Robolectric tests as belonging to the `robolectric-tests` suite since tools expect test modules to belong to at least one suite. Note that tests not marked with a suite implicitly get annotated with the `null-suite`. This is also required for Atest Bazel mode which only includes files of test modules with a non-empty suite attribute in the Tradefed test directory. See aosp/2181295 for more details. Test: m out/target/product/vsoc_x86_64/module-info.json Bug: 222437352 Bug: 228799625 Change-Id: I9dedaf1661a351c32d2affbaf1f9b89d672acc3a --- java/robolectric.go | 1 + 1 file changed, 1 insertion(+) diff --git a/java/robolectric.go b/java/robolectric.go index 2cb07981e..3a6b4acce 100644 --- a/java/robolectric.go +++ b/java/robolectric.go @@ -296,6 +296,7 @@ func (r *robolectricTest) AndroidMkEntries() []android.AndroidMkEntries { entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true) + entries.AddStrings("LOCAL_COMPATIBILITY_SUITE", "robolectric-tests") }) entries.ExtraFooters = []android.AndroidMkExtraFootersFunc{