Add *.GTS variants of our tests

Note: actually annotating tests with @GmsTest will follow

Bug: 384863546
Test: build the tests
Change-Id: Ie84ae0f8cee63d7a0e2509d5dc3e0b59d9f2faed
Merged-In: Ie84ae0f8cee63d7a0e2509d5dc3e0b59d9f2faed
diff --git a/tests/hostside/Android.bp b/tests/hostside/Android.bp
index a46db14..f83b293 100644
--- a/tests/hostside/Android.bp
+++ b/tests/hostside/Android.bp
@@ -84,6 +84,15 @@
     data_native_bins: BINS,
 }
 
+java_test_host {
+    name: "MicrodroidHostTestCases.GTS",
+    defaults: ["MicrodroidHostTestCases.default"],
+    test_config: ":MicrodroidHostTestCases.GTS.config",
+    test_suites: ["gts"],
+    data: DEVICE_DATA,
+    data_native_bins: BINS,
+}
+
 genrule {
     name: "MicrodroidHostTestCases.CTS.config",
     srcs: ["AndroidTest.xml"],
@@ -105,3 +114,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 01af51c..e495d10 100644
--- a/tests/testapk/Android.bp
+++ b/tests/testapk/Android.bp
@@ -93,6 +93,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"],
@@ -115,6 +124,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"],