summaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2019-12-14 02:07:16 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-12-14 02:07:16 +0000
commitac68248051e778708f665e16ed364103a6f9897c (patch)
tree5b4be4cfb8a2c00fcf07f3a81a1e2cf4031c0fd3 /apex/apex_test.go
parenta2fce65a9e523f2090eae600086dc1b9dff057fd (diff)
parent214bf37311d0f376ccfdcc784bd8a0d9b60fb600 (diff)
Merge "Add "legacy_android10_support" to "apex""
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go31
1 files changed, 26 insertions, 5 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index a5ccc1bdc..3aa72e391 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -140,8 +140,8 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
ctx.BottomUp("prebuilts", android.PrebuiltMutator).Parallel()
})
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
- ctx.BottomUp("link", cc.LinkageMutator).Parallel()
ctx.BottomUp("vndk", cc.VndkMutator).Parallel()
+ ctx.BottomUp("link", cc.LinkageMutator).Parallel()
ctx.BottomUp("test_per_src", cc.TestPerSrcMutator).Parallel()
ctx.BottomUp("version", cc.VersionMutator).Parallel()
ctx.BottomUp("begin", cc.BeginMutator).Parallel()
@@ -547,9 +547,10 @@ func TestApexManifest(t *testing.T) {
`)
module := ctx.ModuleForTests("myapex", "android_common_myapex_image")
- module.Output("apex_manifest.pb")
- module.Output("apex_manifest.json")
- module.Output("apex_manifest_full.json")
+ args := module.Rule("apexRule").Args
+ if manifest := args["manifest"]; manifest != module.Output("apex_manifest.pb").Output.String() {
+ t.Error("manifest should be apex_manifest.pb, but " + manifest)
+ }
}
func TestBasicZipApex(t *testing.T) {
@@ -2452,7 +2453,7 @@ func TestApexWithTests(t *testing.T) {
ensureContains(t, androidMk, "LOCAL_MODULE := mytest1.myapex\n")
ensureContains(t, androidMk, "LOCAL_MODULE := mytest2.myapex\n")
ensureContains(t, androidMk, "LOCAL_MODULE := mytest3.myapex\n")
- ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.json.myapex\n")
+ ensureContains(t, androidMk, "LOCAL_MODULE := apex_manifest.pb.myapex\n")
ensureContains(t, androidMk, "LOCAL_MODULE := apex_pubkey.myapex\n")
ensureContains(t, androidMk, "LOCAL_MODULE := myapex\n")
}
@@ -3034,6 +3035,26 @@ func TestOverrideApex(t *testing.T) {
ensureNotContains(t, androidMk, "LOCAL_MODULE_STEM := myapex.apex")
}
+func TestLegacyAndroid10Support(t *testing.T) {
+ ctx, _ := testApex(t, `
+ apex {
+ name: "myapex",
+ key: "myapex.key",
+ legacy_android10_support: true,
+ }
+
+ apex_key {
+ name: "myapex.key",
+ public_key: "testkey.avbpubkey",
+ private_key: "testkey.pem",
+ }
+ `)
+
+ module := ctx.ModuleForTests("myapex", "android_common_myapex_image")
+ args := module.Rule("apexRule").Args
+ ensureContains(t, args["opt_flags"], "--manifest_json "+module.Output("apex_manifest.json").Output.String())
+}
+
func TestMain(m *testing.M) {
run := func() int {
setUp()