summaryrefslogtreecommitdiff
path: root/sdk/cc_sdk_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'sdk/cc_sdk_test.go')
-rw-r--r--sdk/cc_sdk_test.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go
index 6f9dc3c17..6727b4bf0 100644
--- a/sdk/cc_sdk_test.go
+++ b/sdk/cc_sdk_test.go
@@ -225,6 +225,63 @@ func TestSdkWithCc(t *testing.T) {
`)
}
+func TestSnapshotWithObject(t *testing.T) {
+ result := testSdkWithCc(t, `
+ sdk {
+ name: "mysdk",
+ native_objects: ["crtobj"],
+ }
+
+ cc_object {
+ name: "crtobj",
+ stl: "none",
+ }
+ `)
+
+ result.CheckSnapshot("mysdk", "",
+ checkAndroidBpContents(`
+// This is auto-generated. DO NOT EDIT.
+
+cc_prebuilt_object {
+ name: "mysdk_crtobj@current",
+ sdk_member_name: "crtobj",
+ stl: "none",
+ arch: {
+ arm64: {
+ srcs: ["arm64/lib/crtobj.o"],
+ },
+ arm: {
+ srcs: ["arm/lib/crtobj.o"],
+ },
+ },
+}
+
+cc_prebuilt_object {
+ name: "crtobj",
+ prefer: false,
+ stl: "none",
+ arch: {
+ arm64: {
+ srcs: ["arm64/lib/crtobj.o"],
+ },
+ arm: {
+ srcs: ["arm/lib/crtobj.o"],
+ },
+ },
+}
+
+sdk_snapshot {
+ name: "mysdk@current",
+ native_objects: ["mysdk_crtobj@current"],
+}
+`),
+ checkAllCopyRules(`
+.intermediates/crtobj/android_arm64_armv8-a/crtobj.o -> arm64/lib/crtobj.o
+.intermediates/crtobj/android_arm_armv7-a-neon/crtobj.o -> arm/lib/crtobj.o
+`),
+ )
+}
+
func TestSnapshotWithCcDuplicateHeaders(t *testing.T) {
result := testSdkWithCc(t, `
sdk {