summaryrefslogtreecommitdiff
path: root/androidmk
diff options
context:
space:
mode:
author Yuntao Xu <yuntaoxu@google.com> 2022-04-05 15:34:38 -0700
committer Yuntao Xu <yuntaoxu@google.com> 2022-04-05 18:40:19 -0700
commitb8e80350d2b8194ae8dc3a954192448f7846726a (patch)
tree221f660978b40972366c2bd4adc4601486682654 /androidmk
parent4242115d59289791600d42fbc62eade3a1b40519 (diff)
rewrite android_app to android_test in mk2bp
1. When a converted android_app module has the `test_suites` property, rewrite the module type to an android_test one; 2. Refactor the existing codes for rewriting cc_binary to cc_test. Bug: 217650002 Test: add unit and end-to-end tests Test: TreeHugger Change-Id: I90d744a2ae93561f63ed8606f37ea4aa26fa6137
Diffstat (limited to 'androidmk')
-rw-r--r--androidmk/androidmk/androidmk_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/androidmk/androidmk/androidmk_test.go b/androidmk/androidmk/androidmk_test.go
index 21763613a..afde68b49 100644
--- a/androidmk/androidmk/androidmk_test.go
+++ b/androidmk/androidmk/androidmk_test.go
@@ -1690,6 +1690,21 @@ android_app {
}
`,
},
+ {
+ desc: "convert android_app to android_test when having test_suites",
+ in: `
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_COMPATIBILITY_SUITE := bar
+include $(BUILD_PACKAGE)
+ `,
+ expected: `
+android_test {
+ name: "foo",
+ test_suites: ["bar"],
+}
+`,
+ },
}
func TestEndToEnd(t *testing.T) {