summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-03-20 02:38:30 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-03-20 02:38:30 +0000
commit1f4ffda2eda2bc2a459e280a26efab24ca54d61d (patch)
treea93e19b83e7fc544061af4d7f9ff6fb41b7f9977
parent5c0a491e0a1a8ba73987cb461e15f3e08e8c9120 (diff)
parent750334a0c0676a3100d2f6e9a57ea3e0363c4b16 (diff)
Merge "Support multilib property for cc_genrule" into main
-rw-r--r--cc/genrule_test.go44
-rw-r--r--genrule/genrule.go2
2 files changed, 45 insertions, 1 deletions
diff --git a/cc/genrule_test.go b/cc/genrule_test.go
index 05c644f1e..08962065a 100644
--- a/cc/genrule_test.go
+++ b/cc/genrule_test.go
@@ -210,3 +210,47 @@ func TestVendorProductVariantGenrule(t *testing.T) {
t.Errorf(`expected product variant, but does not exist in %v`, variants)
}
}
+
+// cc_genrule is initialized to android.InitAndroidArchModule
+// that is an architecture-specific Android module.
+// So testing properties tagged with `android:"arch_variant"`
+// for cc_genrule.
+func TestMultilibGenruleOut(t *testing.T) {
+ bp := `
+ cc_genrule {
+ name: "gen",
+ cmd: "cp $(in) $(out)",
+ srcs: ["foo"],
+ multilib: {
+ lib32: {
+ out: [
+ "subdir32/external-module32",
+ ],
+ },
+ lib64: {
+ out: [
+ "subdir64/external-module64",
+ ],
+ },
+ },
+ }
+ `
+ result := PrepareForIntegrationTestWithCc.RunTestWithBp(t, bp)
+ gen_32bit := result.ModuleForTests("gen", "android_arm_armv7-a-neon").OutputFiles(t, "")
+ android.AssertPathsEndWith(t,
+ "genrule_out",
+ []string{
+ "subdir32/external-module32",
+ },
+ gen_32bit,
+ )
+
+ gen_64bit := result.ModuleForTests("gen", "android_arm64_armv8-a").OutputFiles(t, "")
+ android.AssertPathsEndWith(t,
+ "genrule_out",
+ []string{
+ "subdir64/external-module64",
+ },
+ gen_64bit,
+ )
+}
diff --git a/genrule/genrule.go b/genrule/genrule.go
index a2a3f7584..cf2a96673 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -808,7 +808,7 @@ func GenRuleFactory() android.Module {
type genRuleProperties struct {
// names of the output files that will be generated
- Out []string
+ Out []string `android:"arch_variant"`
}
var Bool = proptools.Bool