summaryrefslogtreecommitdiff
path: root/java/app_test.go
diff options
context:
space:
mode:
author Jaewoong Jung <jungjw@google.com> 2020-12-07 14:33:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-12-07 14:33:17 +0000
commit71debbfcc5418929dca12cd6bfe1a1e9030a23cc (patch)
tree85910dbb34c0bd079953aecca7bb9799267442f3 /java/app_test.go
parent25c14959a2c1bac65fbfbe51693a5d6717c5ca26 (diff)
parent84f1b808664b9f764de6e97ba312911d3834e2a1 (diff)
Merge "No matching variant android_app_import fix"
Diffstat (limited to 'java/app_test.go')
-rw-r--r--java/app_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/java/app_test.go b/java/app_test.go
index 8523b874f..ef5e84dd2 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -2524,6 +2524,24 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) {
`,
expected: "prebuilts/apk/app.apk",
},
+ {
+ name: "no matching arch without default",
+ bp: `
+ android_app_import {
+ name: "foo",
+ arch: {
+ arm: {
+ apk: "prebuilts/apk/app_arm.apk",
+ },
+ },
+ presigned: true,
+ dex_preopt: {
+ enabled: true,
+ },
+ }
+ `,
+ expected: "",
+ },
}
jniRuleRe := regexp.MustCompile("^if \\(zipinfo (\\S+)")
@@ -2531,6 +2549,12 @@ func TestAndroidAppImport_ArchVariants(t *testing.T) {
ctx, _ := testJava(t, test.bp)
variant := ctx.ModuleForTests("foo", "android_common")
+ if test.expected == "" {
+ if variant.Module().Enabled() {
+ t.Error("module should have been disabled, but wasn't")
+ }
+ continue
+ }
jniRuleCommand := variant.Output("jnis-uncompressed/foo.apk").RuleParams.Command
matches := jniRuleRe.FindStringSubmatch(jniRuleCommand)
if len(matches) != 2 {