From 787328b577286d3db55880b40359ba5dc23bf9b9 Mon Sep 17 00:00:00 2001
From: Ronald Braunstein <rbraunstein@google.com>
Date: Tue, 7 May 2024 22:32:04 -0700
Subject: [PATCH] Use import for test-mapping rather than requesting files
 remain in sync

If there were intervening parent directories with extra TEST_MAPPING
files, then "imports" might pick up extra modules, but in this case that
won't happen.
This change will ensure these two TEST_MAPPING file remain in sync.

Test: atest -p frameworks/base/tools/hoststubgen:ravenwood-presubmit --dry-run
	Finding Tests...
	Found 'RavenwoodBivalentTest' as MODULE
	Found 'RavenwoodMockitoTest' as MODULE
	Found 'RavenwoodMinimumTest' as MODULE
	Found 'RavenwoodCoreTest' as MODULE
	Found 'CtsUtilTestCasesRavenwood' as MODULE
Change-Id: I89d308e1596fa689aeb3c2e476c7707c0ff4dd8f
---
 tools/hoststubgen/TEST_MAPPING | 60 ++--------------------------------
 1 file changed, 2 insertions(+), 58 deletions(-)

diff --git a/tools/hoststubgen/TEST_MAPPING b/tools/hoststubgen/TEST_MAPPING
index f6885e1e74ba..856e6eefba15 100644
--- a/tools/hoststubgen/TEST_MAPPING
+++ b/tools/hoststubgen/TEST_MAPPING
@@ -1,63 +1,7 @@
-// Keep the following two TEST_MAPPINGs in sync:
-// frameworks/base/ravenwood/TEST_MAPPING
-// frameworks/base/tools/hoststubgen/TEST_MAPPING
 {
-  "presubmit": [
-    { "name": "tiny-framework-dump-test" },
-    { "name": "hoststubgentest" },
-    { "name": "hoststubgen-invoke-test" },
+  "imports": [
     {
-      "name": "RavenwoodMockitoTest_device"
-    },
-    {
-      "name": "RavenwoodBivalentTest_device"
-    },
-    // The sysui tests should match vendor/unbundled_google/packages/SystemUIGoogle/TEST_MAPPING
-    {
-      "name": "SystemUIGoogleTests",
-      "options": [
-        {
-          "exclude-annotation": "org.junit.Ignore"
-        },
-        {
-          "exclude-annotation": "androidx.test.filters.FlakyTest"
-        }
-      ]
-    }
-  ],
-  "presubmit-large": [
-    {
-      "name": "SystemUITests",
-      "options": [
-        {
-          "exclude-annotation": "androidx.test.filters.FlakyTest"
-        },
-        {
-          "exclude-annotation": "org.junit.Ignore"
-        }
-      ]
-    }
-  ],
-  "ravenwood-presubmit": [
-    {
-      "name": "RavenwoodMinimumTest",
-      "host": true
-    },
-    {
-      "name": "RavenwoodMockitoTest",
-      "host": true
-    },
-    {
-      "name": "CtsUtilTestCasesRavenwood",
-      "host": true
-    },
-    {
-      "name": "RavenwoodCoreTest",
-      "host": true
-    },
-    {
-      "name": "RavenwoodBivalentTest",
-      "host": true
+      "path": "frameworks/base/ravenwood"
     }
   ]
 }
-- 
GitLab