Add *.GTS variants of our tests

Note: actually annotating tests with @GmsTest will follow

Bug: 384863546
Test: build the tests
Change-Id: Ie84ae0f8cee63d7a0e2509d5dc3e0b59d9f2faed
diff --git a/tests/hostside/Android.bp b/tests/hostside/Android.bp
index 0966c20..d6ae36b 100644
--- a/tests/hostside/Android.bp
+++ b/tests/hostside/Android.bp
@@ -86,6 +86,15 @@
     data_native_bins: BINS,
 }
 
+java_test_host {
+    name: "MicrodroidHostTestCases.GTS",
+    defaults: ["MicrodroidHostTestCases.default"],
+    test_config: ":MicrodroidHostTestCases.GTS.config",
+    test_suites: ["gts"],
+    device_common_data: DEVICE_DATA,
+    data_native_bins: BINS,
+}
+
 genrule {
     name: "MicrodroidHostTestCases.CTS.config",
     srcs: ["AndroidTest.xml"],
@@ -107,3 +116,14 @@
         "-e 's/MicrodroidHostTestCases.jar/MicrodroidHostTestCases.VTS.jar/' " +
         "$(in) > $(out)",
 }
+
+genrule {
+    name: "MicrodroidHostTestCases.GTS.config",
+    srcs: ["AndroidTest.xml"],
+    out: ["out.xml"],
+    cmd: "sed " +
+        "-e 's/<!-- PLACEHOLDER_FOR_ANNOTATION -->/" +
+        "<option name=\"include-annotation\" value=\"com.android.compatibility.common.util.GmsTest\" \\/>/' " +
+        "-e 's/MicrodroidHostTestCases.jar/MicrodroidHostTestCases.GTS.jar/' " +
+        "$(in) > $(out)",
+}
diff --git a/tests/testapk/Android.bp b/tests/testapk/Android.bp
index cb374a5..69a8044 100644
--- a/tests/testapk/Android.bp
+++ b/tests/testapk/Android.bp
@@ -95,6 +95,15 @@
     data: DATA,
 }
 
+android_test {
+    name: "MicrodroidTestApp.GTS",
+    defaults: ["MicrodroidVersionsTestAppDefaults"],
+    manifest: "AndroidManifestV5.xml",
+    test_suites: ["gts"],
+    test_config: ":MicrodroidTestApp.GTS.config",
+    data: DATA,
+}
+
 genrule {
     name: "MicrodroidTestApp.CTS.config",
     srcs: ["AndroidTest.xml"],
@@ -117,6 +126,17 @@
         "$(in) > $(out)",
 }
 
+genrule {
+    name: "MicrodroidTestApp.GTS.config",
+    srcs: ["AndroidTest.xml"],
+    out: ["out.xml"],
+    cmd: "sed " +
+        "-e 's/<!-- PLACEHOLDER_FOR_ANNOTATION -->/" +
+        "<option name=\"include-annotation\" value=\"com.android.compatibility.common.util.GmsTest\" \\/>/' " +
+        "-e 's/MicrodroidTestApp.apk/MicrodroidTestApp.GTS.apk/' " +
+        "$(in) > $(out)",
+}
+
 android_test_helper_app {
     name: "MicrodroidTestAppUpdated",
     defaults: ["MicrodroidVersionsTestAppDefaults"],